]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes notices produced by PHP when saving new strings into _local without correspondi...
authormudrd8mz <mudrd8mz>
Tue, 21 Aug 2007 23:10:18 +0000 (23:10 +0000)
committermudrd8mz <mudrd8mz>
Tue, 21 Aug 2007 23:10:18 +0000 (23:10 +0000)
admin/lang.php

index 2f306c8f31deeb0c92d1c6b2c0871f120d35ae45..0df3b502adadcfea63d35a390a196fa8ece291b6 100644 (file)
@@ -711,8 +711,9 @@ function lang_save_file($path, $file, $strings, $local, $packstrings) {
         @list($id, $stringname) = explode('XXX',$key);
         $value = lang_fix_value_before_save($value);
         if ($id == "string" and $value != ""){
-            if ((!$local) || (lang_fix_value_from_file($packstrings[$stringname]) <> lang_fix_value_from_file($value))) {
+            if ((!$local) || (!isset($packstrings[$stringname])) || (lang_fix_value_from_file($packstrings[$stringname]) <> lang_fix_value_from_file($value))) {
                 // Either we are saving the master language pack
+                // or the string is not saved in packstring - fixes PHP notices about missing key
                 // or we are saving local language pack and the strings differ.
                 fwrite($f,"\$string['$stringname'] = '$value';\n");
             }