Actions
Bug #19482
closedhook in tslib_fe::contentStrReplace isn't flexible enough
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2008-10-18
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
The Hook in tslib_fe::contentStrReplace uses an array with $search and $replace which is good for simple replace like
$params['search'][] = 'typo3';
$params['replace'][] = 'TYPO3';
For the case you want to replace more complex stuff it can't be done this way.
For Example if you have a cached page and you want to output click-counter of items you need to search with reg. expressions, fetch the record and replace it with the field value.
In this case it's easy to pass the content too without changing the count of parameters in the hook, so it's 100% backward compatible.
Once the content is passed you have the freedom to do any complex operation with it.
I did this with the attached patch.
(issue imported from #M9602)
Files
Actions