need help: phpdig suddenly reads html-comments!
hi!
i've been using phpdig for about 1 year now and it has always worked fine. but now suddenly - and i haven't changed anything - it starts to read html-comments in the source-code and put's it into the description. and as that of course has nothing to do in the results page for the user, i'd like to get rid of that. has anyone else ever experienced that problem and knows a "cure"? |
How about look at this and modify the if statement?
|
no, that is not my problem. it doesn't only red that exclude-comment, but all html-comments! so i got stuff like "main table starts here" ect. in my results-page.
that really sucks! any ideas why that is? |
Hi. What version of PHP do you have? Try running the following. What are the results when viewing the HTML source?
PHP Code:
Code:
<!-- test -->A<br> |
Hmm :D there are my problems which i also post here:
PHP 4.3.2 - Result: Code:
<!-- test -->A<br> -Roland- |
Hi. It seems that strip_tags in PHP 4.3.2 has been reworked, making it so that it doesn't eliminate as much as before. The following will remove everything between the < and > symbols.
In robot_functions.php, replace: PHP Code:
PHP Code:
|
I also found something:
Code:
$text = preg_replace('/<.*>/U', '', $text); -Roland- |
Quote:
PHP Code:
|
@charter:
that really seems to be the problem. my hoster must have updated php. what i get is <!-- test -->A<br> <!-- test -->B<br> <!-- test -->C<br> <!-- test -->D<br> <!-- test -->E<br> <!-- test -->F<br> <! test >G<br> < test >H<br> < test >I<br> < test >J<br> the server is running PHP Version 4.3.3. i'm now gonna try indexing with the $text = ereg_replace("[[:blank:]]+"," ",eregi_replace("<[^>]*>","",$text)); workaround you posted. thanks! :-) |
and that seems to work. great. thanks again!
|
Hm okay, what is now the better solution for the future ?
Code:
//replace any group of blank characters by an unique space Code:
//replace any group of blank characters by an unique space |
Hi. My personal preference would be to use
PHP Code:
PHP Code:
|
i just used this line
$text = ereg_replace("[[:blank:]]+"," ",eregi_replace("<[^>]*>","",$text)); and it seems to work perfectly. and that's good enough i guess. ;-) |
dammit. it still doesn't work. after completely reindexing the page (that takes some hours) i got comments in the results page again.
the original comment-line was <!----------sub-navbar table ends here----------> and in the html-source of the results page now i still find this: < sub-navbar table ends here > all my comments start with <!---------- and end with ---------->. unfortunately i'm not a php-crack, but it somehow has to be possible to get rid of that and everthing in between. is it? |
Quote:
This is quite expected behaviour. The SGML specification doesn't allow whitespaces to appear right after the less than sign.: http://bugs.php.net/bug.php?id=25730 -Roland- |
All times are GMT -8. The time now is 02:53 PM. |
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.