From: tjhunt Date: Fri, 16 Jan 2009 04:18:43 +0000 (+0000) Subject: moodlelib: MDL-17761 More consistent error handling in get_string. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=4cfd5d4d8fe0392a000ec92925776963bc44e813;p=moodle.git moodlelib: MDL-17761 More consistent error handling in get_string. --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index ac669dfd01..35b071e06c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -5463,14 +5463,18 @@ function get_string($identifier, $module='', $a=NULL, $extralocations=NULL) { $langfile = $location.$lang.'/'.$filetocheck; if (file_exists($langfile)) { if ($result = get_string_from_file('parentlanguage', $langfile, "\$parentlang")) { - eval($result); + if (eval($result) === FALSE) { + trigger_error('Lang error: '.$identifier.':'.$langfile, E_USER_NOTICE); + } if (!empty($parentlang)) { // found it! //first, see if there's a local file for parent $locallangfile = $location.$parentlang.'_local'.'/'.$module.'.php'; 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; } }