From 145ec44bf76d93faa7913264ab4c45f98e519db3 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 14 Jul 2005 16:00:23 +0000 Subject: [PATCH] FIx for bug 3181 - empty files are no longer created - make your own! :-) --- admin/lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/admin/lang.php b/admin/lang.php index 80407f9dc9d..f8519459ade 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -90,23 +90,22 @@ // For each file, check that a counterpart exists, then check all the strings foreach ($stringfiles as $file) { - if (!file_exists("$langdir/$file")) { - if (!touch("$langdir/$file")) { - echo "

".get_string("filemissing", "", "$langdir/$file")."

"; - continue; - } - } - unset($string); include("$enlangdir/$file"); $enstring = $string; - + unset($string); - include("$langdir/$file"); + + if (file_exists("$langdir/$file")) { + include("$langdir/$file"); + } else { + notify(get_string("filemissing", "", "$langdir/$file")); + $string = array(); + } $first = true; foreach ($enstring as $key => $value) { - if (!isset($string[$key]) or $string[$key] == "") { + if (empty($string[$key])) { $value = htmlspecialchars($value); $value = str_replace("$"."a", "\\$"."a", $value); $value = str_replace("%%","%",$value);