Project

General

Profile

Actions

Bug #15396

closed

class.indexer.php - problem with removing the scripting and style stuff in function embracingTags

Added by Milena Trapcheva almost 19 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2006-01-12
Due date:
% Done:

0%

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

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 . "[^>]*?>.*?'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

class.indexer.php (71.3 KB) class.indexer.php Administrator Admin, 2006-01-12 17:26
Actions #1

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)?

Actions #2

Updated by Alexander Opitz about 11 years ago

  • Status changed from Needs Feedback to Closed

No feedback for over 90 days.

Actions

Also available in: Atom PDF