Some better error checking to help us pick bad lang files

This commit is contained in:
moodler
2008-02-21 05:59:50 +00:00
parent 0746cf3e40
commit 71ebb06911
+6 -2
View File
@@ -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;
}
}