]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes MDL-11327. Error when trying to include a non existing file.
authormudrd8mz <mudrd8mz>
Wed, 19 Sep 2007 17:58:03 +0000 (17:58 +0000)
committermudrd8mz <mudrd8mz>
Wed, 19 Sep 2007 17:58:03 +0000 (17:58 +0000)
admin/lang.php

index 0df3b502adadcfea63d35a390a196fa8ece291b6..2c5de4db98c122aad8e17e3d5c5579f2c3558757 100644 (file)
 
             unset($newstrings['currentfile']);
 
+            $packstring = array();
+            $saveinto = $langdir;
             if ($uselocal) {
-                include($trfilepath);
-                if (isset($string)) {
-                    $packstring = $string;
-                } else {
-                    $packstring = array();
+                if(file_exists($trfilepath)) {
+                    include($trfilepath);
+                    if (isset($string)) {
+                        $packstring = $string;
+                    }
+                    unset($string);
                 }
-                unset($string);
                 $saveinto = $locallangdir;
-            } else {
-                $packstring = array();
-                $saveinto = $langdir;
             }
-
+             
             if (lang_save_file($saveinto, $currentfile, $newstrings, $uselocal, $packstring)) {
                 notify(get_string("changessaved")." ($saveinto/$currentfile)", "green");
             } else {