[TYPO3-core] RFC #8637: Bug: t3lib_parsehtml::substituteMarkerArray() deletes too much if wrap is not set

Francois Suter fsuter at cobweb.ch
Sat Jun 7 22:27:17 CEST 2008


This is an SVN patch request.

Type: Bugfix

Bugtracker references:
http://bugs.typo3.org/view.php?id=8637

Branches:
4_2 and Trunk

Problem:
In RFC 0007383 a 5th parameter was added to 
t3lib_parsehtml::substituteMarkerArray() to remove unused markers. It 
does so with the following line:

$content = 
preg_replace('/'.preg_quote($wrapArr[0]).'([A-Z0-9_-|]*)'.preg_quote($wrapArr[1]).'/is', 
'', $content);

This will fail if the marker wrap is not defined, because the default 
wrap is ### where the $wrapArr is empty when no wrap is passed to this 
method.

Solution:
The solution is to initialise $wrapArr when no marker wrap argument was 
passed.

Notes:
The solution is really simple, but I think the bug is pretty bad as it 
can be quite a surprise to extension authors in particular. The fix is 
easy, so I hope this can make it in time into 4.2.1.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug8637.patch
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080607/71d75aaa/attachment.txt 


More information about the TYPO3-team-core mailing list