[TYPO3-core] RFC: #10359: Empty subparts are ignored

Jigal van Hemert jigal at xs4all.nl
Sat Aug 15 10:41:51 CEST 2009


This is an SVN patch request.

Type: Bugfix

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

Branches: TYPO3_4-2, Trunk

Problem:
t3lib_parsehtml::getSubPart() returns an empty string if the subpart 
marker pair is not found, but it also returns an empty string if the 
subpart marker pair is found but there is nothing between the subpart 
markers (or the content is a zero ('0')).
For code which calls getSubPart() there is no way to distinguish between 
and empty, but existing subpart and a non-existing subpart.
In many case the return value is evaluated as boolean:
$html = t3lib_parsehtml::getSubPart($template, $marker);
if ($html) {
...
So anything between the subpart markers that evaluates to 'false' causes 
the code to think that the subpart markers weren't found at all.

Solution:
If the marker-pair is found any content which evaluates to 'false' will 
be replaced with a dummy value (default: '<!-- -->').

-- 
Jigal van Hemert.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 10359_trunk.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090815/dc3a036a/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 10359_branch4-2.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20090815/dc3a036a/attachment-0003.txt 


More information about the TYPO3-team-core mailing list