]> git.mjollnir.org Git - moodle.git/commitdiff
Added some detection of bad strings from 1.9
authormoodler <moodler>
Thu, 21 Feb 2008 06:01:01 +0000 (06:01 +0000)
committermoodler <moodler>
Thu, 21 Feb 2008 06:01:01 +0000 (06:01 +0000)
lib/moodlelib.php

index afee285ca7d01f30f35d69d4259fcc24c2c9213d..213d5c2d92ec1cc9153b7e5ebdeb00503bfbe5bb 100644 (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;
             }
        }