X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Finst_lang.php;h=71fedd5b7e3e192d103484720fe9c5f411a4282e;hb=5e8a0ec17ca39d933e8127c69aef02825725e236;hp=e1fbd0636270513e6011633853efbdb5d64eb535;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/admin/inst_lang.php b/admin/inst_lang.php index e1fbd063..71fedd5b 100644 --- a/admin/inst_lang.php +++ b/admin/inst_lang.php @@ -30,7 +30,7 @@ simple_page_mode(true); // function display_languages() { - global $table_style, $installed_languages, $dflt_lang; + global $table_style, $installed_languages, $dflt_lang, $GetText; $th = array(_("Language"), _("Name"), _("Encoding"), _("Right To Left"), _("Installed"), _("Available"), _("Default"), "", ""); @@ -75,9 +75,9 @@ function display_languages() else alt_table_row_color($k); - $support = $_SESSION['get_text']->check_support($lang, $charset); + $support = $GetText->check_support($lang, $charset); - if (function_exists('gettext') && !$support && !get_post('DisplayAll')) continue; + if (function_exists('gettext') && !$support && !get_post('DisplayAll') && $lang != 'C') continue; label_cell($lang); label_cell($available ? get_package_view_str($lang, $lang_name) : $lang_name); @@ -169,7 +169,8 @@ function handle_submit($id) if (is_uploaded_file($_FILES['uploadfile']['tmp_name'])) { $file1 = $_FILES['uploadfile']['tmp_name']; - $file2 = $directory . "/LC_MESSAGES/".$_POST['code'].".po"; + $code = preg_replace('/[^a-zA-Z_]/', '', $_POST['code']); + $file2 = $directory . "/LC_MESSAGES/$code.po"; if (file_exists($file2)) unlink($file2); move_uploaded_file($file1, $file2); @@ -177,7 +178,8 @@ function handle_submit($id) if (is_uploaded_file($_FILES['uploadfile2']['tmp_name'])) { $file1 = $_FILES['uploadfile2']['tmp_name']; - $file2 = $directory . "/LC_MESSAGES/".$_POST['code'].".mo"; + $code = preg_replace('/[^a-zA-Z_]/', '', $_POST['code']); + $file2 = $directory . "/LC_MESSAGES/$code.mo"; if (file_exists($file2)) unlink($file2); move_uploaded_file($file1, $file2); @@ -292,4 +294,4 @@ if (isset($_GET['popup']) || get_post('Add') || $Mode == 'Edit' || $Mode == 'ADD //--------------------------------------------------------------------------------------------- end_page(); -?> \ No newline at end of file +?>