#27361 [Opn->Fbk]: strip_tags() doesn't fail on incomplete tag if there is non-html output before.
| From: | derick@php.net | Date: | Mon, 23 Feb 2004 21:39:53 +0000 |
| Subject: | #27361 [Opn->Fbk]: strip_tags() doesn't fail on incomplete tag if there is non-html output before. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-55413@lists.php.net to get a copy of this message | ||
ID: 27361
Updated by: derick@php.net
Reported By: stu-php at better dot domain dot name
-Status: Open
+Status: Feedback
Bug Type: Strings related
Operating System: Windows Server 2003
PHP Version: 5.0.0b4 (beta4)
New Comment:
Explain in one line what the bug is then...I don't see it either.
Previous Comments:
------------------------------------------------------------------------
[2004-02-23 16:36:36] stu-php at better dot domain dot name
This is NOT a bogus bug. Just because the MAIN functionality of the
function is there does not mean that there is not a bug here.
The function behaves in an unexpected manner. That is a bug.
If the documentation contradicts the actual function then something
needs to be fixed. Either the documentation or the function code.
------------------------------------------------------------------------
[2004-02-23 13:54:24] sniper@php.net
Try outputting the actual result of the strip_tags() and you'll see
that it works perfectly. (strip_tags() is not any validator...whatever
the docs say)
------------------------------------------------------------------------
[2004-02-23 05:18:33] stu-php at better dot domain dot name
Description:
------------
I have discovered that strip_tags() does not fail with an error if used
on a string with an incomplete tag IF there is any non-tag text BEFORE
the incomplete tag.
Reproduce code:
---------------
http://better.domain.name/php/strip.php
There's a link to the source on the page above showing the bug.
Expected result:
----------------
I would expect strip_tags() to fail if there is an incomplete html tag
in the string passed to it, regardless of other input before, or after,
the tag.
"This function tries to return a string with all HTML and PHP tags
stripped from a given str. It errors on the side of caution in case of
incomplete or bogus tags." - http://php.net/strip_tags
Actual result:
--------------
Only errors if there is no plain text before the broken tag.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27361&edit=1