From d456b18f7b3f1083994c767a1a3cffd32b0ca8a1 Mon Sep 17 00:00:00 2001 From: mudrd8mz Date: Wed, 19 Sep 2007 17:58:03 +0000 Subject: [PATCH] Fixes MDL-11327. Error when trying to include a non existing file. --- admin/lang.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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 { -- 2.39.5