[TYPO3-core] RFC: #7370: Delete unused Marker in parsehtml::substituteMarkerArray

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon Feb 4 18:58:00 CET 2008


Steffen Kamper schrieb:
> "Martin Kutschker" <Martin.Kutschker at n0spam-blackbox.net> schrieb im 
> Newsbeitrag 
> news:mailman.1.1202143782.8774.typo3-team-core at lists.netfielders.de...
>> Steffen Kamper schrieb:
>>> This is a SVN patch request.
>>>
>>> Branches: Trunk only
>>>
>>> BT reference: http://bugs.typo3.org/view.php?id=7370
>>>
>>> Type: Feature
>>>
>>> Problem:
>>> There is no way to substitute unused Markers yet
>>>
>>> Solution:
>>> now there is a new flag that can be used to delete these Markers.
>> Looks ok, but you could have used preg_replace to remove all markers in 
>> one go.
>>
>> Masi
> 
> i tried but was not successful. This doesn't work:
> preg_replace('/'.$wrapArr[0].'([A-Z0-9_-|]*)'.$wrapArr[1].'/is','',$content);

This CLI command worked for me
php -r
  'echo preg_replace("/#([A-Z0-9_-|]*)#/is","","a #b# cd #e# f"),"\n";'

> Do you have a suggestion?

preg_replace returns the changed string, it doesn't change the argument.

BTW, please use preg_quote() on the wraps.

Masi

PS: Also note that we here the example of the problematic strtoupper(). 
This will break Turkish sites (as it is affected by the locale). It should 
be strtr('a...z','A..Z').


More information about the TYPO3-team-core mailing list