ID:               46578
 Updated by:       [EMAIL PROTECTED]
 Reported By:      j at ww dot com
-Status:           Verified
+Status:           Closed
 Bug Type:         Strings related
 Operating System: *
 PHP Version:      5CVS, 6CVS (2008-11-21)
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------

[2008-11-15 11:40:57] j at ww dot com

Description:
------------
There is a nasty little gotcha in 'strip_tags', if you have a single
quote inside an html comment strip_tags will ignore the end-of-comment
tag!

So, <!-- test --> this works, but <!-- test I've --> this does not, the
end-of-comment tag will be ignored.



Reproduce code:
---------------
$i = "<!-- testing I've been to mars --> quite so";

echo(strip_tags($i));



Expected result:
----------------
It should read "quite so", instead it returns a blank string,
presumably because no end quote was encountered (the parser has probably
switched into 'attribute' mode, but in a comment there are no
attributes). Adding another quote to the above example will verify this
hypothesis.



Actual result:
--------------
an empty string.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=46578&edit=1

Reply via email to