From fc3d4000d59aed32e209976d9b996100f3d9ead4 Mon Sep 17 00:00:00 2001 From: mudrd8mz Date: Sat, 7 Apr 2007 18:38:04 +0000 Subject: [PATCH] Merged fixes from MOODLE_18_STABLE (from 1.88.2.3 to 1.88.2.4) --- admin/lang.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/admin/lang.php b/admin/lang.php index d361fefe18..ad7f353db5 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -468,8 +468,10 @@ echo ''; } echo ''; - echo ''; - echo ''; + if ($editable) { + echo ''; + echo ''; + } } else { // no $currentfile specified @@ -526,10 +528,12 @@ function lang_save_file($path, $file, $strings, $local, $packstrings) { $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))) { + // Either we are saving the master language pack + // or we are saving local language pack and the strings differ. fwrite($f,"\$string['$stringname'] = '$value';\n"); - if (LANG_KEEP_ORPHANS && isset($orphans[$stringname])) { - unset($orphans[$stringname]); - } + } + if (LANG_KEEP_ORPHANS && isset($orphans[$stringname])) { + unset($orphans[$stringname]); } } } @@ -560,6 +564,7 @@ function lang_fix_value_from_file($value='') { $value = trim($value); // Delete leading/trailing white space $value = str_replace("\\","",$value); // Delete all slashes $value = str_replace("%%","%",$value); + $value = str_replace("&","&",$value); // Fixes MDL-9248 $value = str_replace("<","<",$value); $value = str_replace(">",">",$value); $value = str_replace('"',""",$value); -- 2.39.5