From 90af9dccd327ea1a83923a92e2de9763719381b4 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 21 Feb 2008 06:01:01 +0000 Subject: [PATCH] Added some detection of bad strings from 1.9 --- lib/moodlelib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; } } -- 2.39.5