Actions
Bug #72224
closedproblems introduced by bugfix 44270
Start date:
2015-12-14
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
I have found another error related to the patch for bug #44270.
If you have a $content parameter for substituteMarkerArrayCached which has no marker at all, then an empty result is given back. This is wrong. The full $content must be returned.
Do not store into the cache with substMarkerCache if the result of preg_match_all is 0 or FALSE or $usedMarkers is empty. This will solve this issue.
$storeArr['c'] = preg_split($regex, $content);
$storeArr['k'] = $keyList[0];
}
if (!empty($storeArr)) {
// Setting cache:
$this->substMarkerCache[$storeKey] = $storeArr;
// Storing the cached data:
$GLOBALS['TSFE']->sys_page->storeHash($storeKey, serialize($storeArr), 'substMarkArrayCached');
$GLOBALS['TT']->setTSlogMessage('Parsing', 0);
}
}
} else {
// Unserializing
$storeArr = unserialize($storeArrDat);
// Setting cache:
$this->substMarkerCache[$storeKey] = $storeArr;
The $content must be returned without any change if no marker is inside of it.
if (
isset($storeArr['k'])
) {
$content = '';
// Traversing the keyList array and merging the static and dynamic content
foreach ($storeArr['k'] as $n => $keyN) {
$content .= $storeArr['c'][$n];
if (!is_array($valueArr[$keyN])) {
$content .= $valueArr[$keyN];
} else {
$content .= $valueArr[$keyN][intval($wSCA_reg[$keyN]) % 2];
$wSCA_reg[$keyN]++;
}
}
$content .= $storeArr['c'][count($storeArr['k'])];
$GLOBALS['TT']->pull();
}
return $content;
}
Actions