View Single Post
Old 04-09-2004, 11:15 AM   #1
Jer
Green Mole
 
Join Date: Apr 2004
Posts: 4
phpdigCleanHtml clean too much

with these twolines in function phpdigCleanHtml from robot_functions.php :

$text = eregi_replace("<script[^>]*>.*</script>"," ",$text);
$text = eregi_replace("<style[^>]*>.*</style>"," ",$text);

if we have by example :

<script> fdlsm </script>
important information
<script> fdlsm </script>

the text : "important information" will be erase because the ereg function will take the first <script> and the last </script>

the correction may be :

$text = eregi_replace("<script[^>]*>([^<]+)?</script>","",$text);
$text = eregi_replace("<style[^>]*>([^<]+)?</style>","",$text);
Jer is offline   Reply With Quote