Additional db driver fixes, mysqli api set as default regardless of php version.
[fa-stable.git] / admin / inst_lang.php
index e1fbd0636270513e6011633853efbdb5d64eb535..d533944f71c466e045c5cd2b335effc0fb789d6c 100644 (file)
@@ -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,7 +75,7 @@ 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;
 
@@ -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
+?>