Project

General

Profile

Actions

Bug #19533

closed

Indexing fails with PHP 5.2.5 at call to strip_tags()

Added by Ralf Merz about 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2008-10-30
Due date:
% Done:

0%

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

Description

TYPO3 v4.1.6
indexed_search v2.10.0
PHP v5.2.5

In the HTML Templates the begin and end markers are set only around the content. But only the title has been indexed, no content.

I´ve found out, that in class.indexer.php in function splitHTMLContent($content) on line 627 (+/-) the line
$contentArr['body'] = trim(strip_tags($contentArr['body']));
ended up in an empty string.

Switching back to PHP 4.4.8, the call to strip_tags() worked. For several reasons I have to use PHP 5.2.5, e.g. other TYPO3 v4.2 instances.

So I´ve changed this line to:
$contentArr['body'] = trim(preg_replace("'<[\/\!]*?[^<>]*?>'si","",$contentArr['body']));

Maybe this helps others. For me it works. Maybe someone can confirm this.

Other Special content I have on that page is a generated tipAFriend-link, a print-link an the tt_news latest_view. But I think that was not the problem.

Regards
Ralf

(issue imported from #M9690)

Actions #1

Updated by Ralf Merz about 16 years ago

This issue can also be seen on issue #4934
There the idea to use preg is also mentioned. At the moment i don´t know exactly if this already done in TYPO3 4.2.x

Actions #2

Updated by Dmitry Dulepov over 14 years ago

Not confirmed here.

Actions #3

Updated by Steffen Kamper over 14 years ago

not confirmed too. strip_tags() works as expected using php 5.3

See this Note on php.net:
" Note: If PHP is not properly recognizing the line endings when reading files either on or created by a Macintosh computer, enabling the auto_detect_line_endings run-time configuration option may help resolve the problem."

Actions #4

Updated by Ralf Merz over 14 years ago

Hi Dmity and Steffen,
thanks for your answers. I mostly use PHP 5.3 now, where everything works as expected. One problem now is: I´ve changed the company at the beginning of this year, so I don´t have an access to the system I was talking about when I opened this thread.
Maybe there was a wrong comment, so sth like here happened:
http://bugs.php.net/bug.php?id=52011
http://bugs.php.net/46578

So it´s a pity I cannot reproduce this now. Or let´s just say: it´s good that it´s not reproducable :)
Well I guess that indexed_search is fine as it seems that I was the only one having that error.

So it was a PHP bug and not an indexed_search one, I think.

Greets
Ralf
(merzilla)

Actions #5

Updated by Steffen Kamper over 14 years ago

ok, thanks Ralf. I close this issue for now.

Actions

Also available in: Atom PDF