Bug #19533
closedIndexing fails with PHP 5.2.5 at call to strip_tags()
0%
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)
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
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."
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)
Updated by Steffen Kamper over 14 years ago
ok, thanks Ralf. I close this issue for now.