From: moodler Date: Thu, 21 Feb 2008 06:01:01 +0000 (+0000) Subject: Added some detection of bad strings from 1.9 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=90af9dccd327ea1a83923a92e2de9763719381b4;p=moodle.git Added some detection of bad strings from 1.9 --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index afee285ca7..213d5c2d92 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5175,7 +5175,9 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { $locallangfile = $location.$lang.'_local'.'/'.$module.'.php'; //first, see if there's a local file if (file_exists($locallangfile)) { if ($result = get_string_from_file($identifier, $locallangfile, "\$resultstring")) { - eval($result); + if (eval($result) === FALSE) { + trigger_error('Lang error: '.$identifier.':'.$locallangfile, E_USER_NOTICE); + } return $resultstring; } } @@ -5183,7 +5185,9 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { $langfile = $location.$lang.'/'.$module.'.php'; if (file_exists($langfile)) { if ($result = get_string_from_file($identifier, $langfile, "\$resultstring")) { - eval($result); + if (eval($result) === FALSE) { + trigger_error('Lang error: '.$identifier.':'.$langfile, E_USER_NOTICE); + } return $resultstring; } }