Issue Bug Closed

#44270wrong result in substituteMarkerArrayCached

Franz Holzinger 01/02/13, 10:23 updated 10/02/18, 12:15

Description

After some usage of the function it ends up in an error message.

Core: Error handler (FE): PHP Warning: Invalid argument supplied for foreach() in /var/www/mydomain/typo3_src-4.7.7/typo3/sysext/cms/tslib/class.tslib_content.php line 1727

Which is the line:
foreach ($storeArr[‘k’] as $n => $keyN) {

The debug information is:

class.tslib_content.php 1678:
$storeArrDat = $GLOBALS[‘TSFE’]->sys_page->getHash($storeKey);

a:2:{s:1:“c”;b:0;s:1:“k”;N;}
$storeArrDat after sys_page->getHash (string)

So the $storeArr is an array of k and c with empty values. This causes the next foreach to crash.

In such a case the “if (!isset($storeArrDat)) {” branch should have been reached.

However this still won’t work because after some modification it ends up in:

Core: Error handler (FE): PHP Warning: preg_split(): Compilation failed: regular expression is too large at offset 32848 in /var/www/mydomain/typo3_src-4.7.7/typo3/sysext/cms/tslib/class.tslib_content.php line 1708

So for this issue: It should not throw the foreach error but another details error message in order to know about the wrong preg_split function.

Reviews 2