From 4352f048f5c966120e8d732911055bb625fb3000 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 12 Mar 2006 20:06:12 +0000 Subject: [PATCH] workaround for some more uninitialized offset warnings --- lib/textlib.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/textlib.class.php b/lib/textlib.class.php index ea1b87df79..dc7ac77f25 100644 --- a/lib/textlib.class.php +++ b/lib/textlib.class.php @@ -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. */ -- 2.39.5