]> git.mjollnir.org Git - moodle.git/commitdiff
workaround for some more uninitialized offset warnings
authorskodak <skodak>
Sun, 12 Mar 2006 20:06:12 +0000 (20:06 +0000)
committerskodak <skodak>
Sun, 12 Mar 2006 20:06:12 +0000 (20:06 +0000)
lib/textlib.class.php

index ea1b87df7975c77c8ae5eefaf0314522ba1e4978..dc7ac77f25308e8e05352d005ec78a61529ec278 100644 (file)
@@ -121,8 +121,13 @@ class textlib {
 
     /* Multibyte safe substr() function, uses mbstring if available. */
     function substr($text, $start, $len=null, $charset='utf-8') {
+    /// Avoid some notices from Typo3 code
+        $oldlevel = error_reporting(E_PARSE);
     /// Call Typo3 substr() function. It will do all the work
-        return $this->typo3cs->substr(strtolower($charset),$text,$start,$len);
+        $result = $this->typo3cs->substr(strtolower($charset),$text,$start,$len);
+    /// Restore original debug level
+        error_reporting($oldlevel);
+        return $result;
     }
 
     /* Multibyte safe strlen() function, uses mbstring if available. */