Module: tools Branch: master Commit: fc6ad2b296fb1615b245ab69caf8c6f1d6e9706b URL: http://source.winehq.org/git/tools.git/?a=commit;h=fc6ad2b296fb1615b245ab69c... Author: Paul Vriens <Paul.Vriens.Wine(a)gmail.com> Date: Mon Jul 20 18:10:35 2009 +0200 transl: Rely on kernel32 resources to see if a language is valid. --- transl/php/lib.php | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/transl/php/lib.php b/transl/php/lib.php index ab71631..84bd179 100644 --- a/transl/php/lib.php +++ b/transl/php/lib.php @@ -62,11 +62,13 @@ function enum_locale_names() function validate_lang($id) { - global $DATAROOT; - - $lang = preg_replace("/[^0-9a-f:]/", "-", $id); - if (!file_exists("$DATAROOT/conf/$lang") || !file_exists("$DATAROOT/langs/$lang")) + global $LOCALE_NAMES; + enum_locale_names(); + + if (!isset($LOCALE_NAMES[$id])) die("Invalid lang parameter"); + + $lang = preg_replace("/[^0-9a-f:]/", "-", $id); return $lang; }