Project

General

Profile

Actions

Bug #59889

closed

stdWrap.addParams breaks on comments

Added by Lukas Domnick over 10 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
Category:
TypoScript
Target version:
-
Start date:
2014-06-26
Due date:
% Done:

80%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In typo3\sysext\frontend\Classes\ContentObject\ContentObjectRenderer.php:addParams (line 4191 in Typo3 6.2.3, but the bug has been around since 4.5 at least), exploding the Tag works by exploding by "<". This breaks, if the first opening bracket belongs to a HTML comment.

Example:

HTML content of a content element:

    <!-- begin FCE accordeon -->
    <div class="accordeon">
         [...]
    </div>

applied stdWrap:

    tt_content.stdWrap.addParams.id = cid
    tt_content.stdWrap.addParams.id.dataWrap = |{field:uid}

expected output:

    <!-- begin FCE accordeon -->
    <div id="cid645" class="accordeon">
         [...]
    </div>

actual output:

    <!-- id="cid645" begin FCE accordeon -->
    <div class="accordeon">
         [...]
    </div>

Suggested Fix: Instead of just exploding randomly, match using

    preg_match('/\<[A-Za-z].*?\>/', $content)


Files

isotest.php (7.71 KB) isotest.php Lukas Domnick, 2014-07-10 20:39
Actions

Also available in: Atom PDF