Bug #15396
closedclass.indexer.php - problem with removing the scripting and style stuff in function embracingTags
0%
Description
Hi,
I had 2 script sections in my template file and the function embracingTags() called from splitHTMLContent() removed all the content between the start of the first javascript and the end of the second one:
$tagList = explode(',',$this->excludeSections);
reset($tagList);
while(list(,$tag)=each($tagList)) {
while($this->embracingTags($contentArr['body'],$tag,$dummy,$contentArr['body'],$dummy2));
}
In my case the removed content was all the content parts :(
I replaced the above code with a regexp:
$tagList = explode(',',$this->excludeSections);
reset($tagList);
$i = 0;
while(list(,$tag)=each($tagList)) {
$search[$i] = "'<" . $tag . "[^>]*?>.*?" . $tag . ">'si";
$replace[$i] = "";
$i++;
}
$search[$i] = "'<[\/\!]*?[^<>]*?>'si"; // Strip out html tags
$replace[$i] = "";
$i++;
$search[$i] = "'<[\!]*?[^<>]*?>'si"; // Strip out html comments
$replace[$i] = "";
$i++;
$search[$i] = "'&#(\d+);'e"; // evaluate as php
$replace[$i] = "chr(\\1)";
$i++;
$contentArr['body'] = preg_replace ($search, $replace, $contentArr['body']);
(issue imported from #M2240)
Files
Updated by Alexander Opitz over 11 years ago
- Status changed from New to Needs Feedback
- Target version deleted (
0) - TYPO3 Version set to 4.0
The issue is very old, does this issue exists in newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz about 11 years ago
- Status changed from Needs Feedback to Closed
No feedback for over 90 days.