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


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