Fixed bug #13934: Side-effect of substr in t3lib_cs (thanks to Rens Admiraal)
authorXavier Perseguers <typo3@perseguers.ch>
Thu, 27 May 2010 13:30:58 +0000 (13:30 +0000)
committerXavier Perseguers <typo3@perseguers.ch>
Thu, 27 May 2010 13:30:58 +0000 (13:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-2@7696 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_cs.php

index 0a3f0c5..eee1676 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-27  Xavier Perseguers  <typo3@perseguers.ch>
+
+       * Fixed bug #13934: Side-effect of substr in t3lib_cs (thanks to Rens Admiraal)
+
 2010-05-27  Tobias Liebig  <mail_typo3@etobi.de>
 
        * Fixed bug #14388: TypoScript templates containing a "$1" become corrupted
index efaf322..c38c5e3 100755 (executable)
@@ -1388,7 +1388,9 @@ class t3lib_cs {
         * @author      Martin Kutschker <martin.t.kutschker@blackbox.net>
         */
        function substr($charset,$string,$start,$len=null)      {
-               if ($len===0)   return '';
+               if ($len === 0 || $string === '') {
+                       return '';
+               }
 
                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['t3lib_cs_utils'] == 'mbstring') {
                                // cannot omit $len, when specifying charset