[BUGFIX] Recursion error in typoscript when including typoscript files
authorTobias Liebig <mail_typo3.org@etobi.de>
Thu, 31 Mar 2011 19:48:21 +0000 (21:48 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 17 Apr 2011 17:53:24 +0000 (19:53 +0200)
In template module, when editing typoscript and using the "Include
TypoScript file content" option with more then 9 files, the 10th and
more files got screwed up.

Thanks to André Spindler for reporting and providing a patch.
Thanks to Kilian Hann (futureconnection AG Zürich) for sponsoring
100 beers during the bug auction.

Change-Id: I220ee78da5875ff66753769f2e704a49539dff31
Resolves: #25374
Reviewed-on: http://review.typo3.org/1365
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Sebastian Fischer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/class.t3lib_tsparser.php

index 27c83df..2d25bfb 100644 (file)
@@ -726,7 +726,7 @@ class t3lib_TSparser {
                                        $extractedFileNames[] = $realFileName;
 
                                                // recursive call to detected nested commented include statements
-                                       $fileContentString = self::extractIncludes($fileContentString, ++$cycle_counter, $extractedFileNames);
+                                       $fileContentString = self::extractIncludes($fileContentString, $cycle_counter + 1, $extractedFileNames);
 
                                        if (!t3lib_div::writeFile($realFileName, $fileContentString)) {
                                                throw new Exception(sprintf('Could not write file "%s"', $realFileName));
@@ -894,4 +894,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tsparser.php']);
 }
 
-?>
\ No newline at end of file
+?>