Fixes MDL-11327. Error when trying to include a non existing file.

This commit is contained in:
mudrd8mz
2007-09-19 17:58:03 +00:00
parent 314fc083d9
commit d456b18f7b
+9 -10
View File
@@ -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 {