From: mudrd8mz Date: Wed, 19 Sep 2007 17:58:03 +0000 (+0000) Subject: Fixes MDL-11327. Error when trying to include a non existing file. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d456b18f7b3f1083994c767a1a3cffd32b0ca8a1;p=moodle.git Fixes MDL-11327. Error when trying to include a non existing file. --- diff --git a/admin/lang.php b/admin/lang.php index 0df3b502ad..2c5de4db98 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -422,20 +422,19 @@ 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 {