#31964 [Opn->Bgs]: strip_tags truncates strings at '<<'
ID: 31964
Updated by: tony2001@php.net
Reported By: tom at designsolution dot co dot uk
-Status: Open
+Status: Bogus
Bug Type: Strings related
Operating System: OS X 10.3.8
PHP Version: 4.3.10
New Comment:
This behaviour is documented:
"Because strip_tags() does not actually validate the HTML, partial, or
broken tags can result in the removal of more text/data than
expected."
Your HTML is undoubtfully broken.
See http://php.net/strip_tags
Previous Comments:
------------------------------------------------------------------------
[2005-02-14 09:51:09] tom at designsolution dot co dot uk
Description:
------------
When running strip_tags on a string containing '<<', the string is
truncated at the '<<'.
Reproduce code:
---------------
<?php
$test = "testing << testing testing 1 2 3";
print(strip_tags($test));
?>
Expected result:
----------------
Probably should return the complete string eg:
testing << testing testing 1 2 3
At the worst I would have expected it without the << but certainly
containing the rest.
Actual result:
--------------
testing
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31964&edit=1
Thread (2 messages)