Bug #12120: Several following < characters ignored by striptags()
| From: | michel at eevolved dot com | Date: | Fri, 13 Jul 2001 00:32:58 +0000 |
| Subject: | Bug #12120: Several following < characters ignored by striptags() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-59899@lists.php.net to get a copy of this message | ||
From: michel@eevolved.com
Operating system: Linux Mandrake
PHP version: 4.0.4pl1
PHP Bug Type: Strings related
Bug description: Several following < characters ignored by striptags()
$foo = strip_tags("< < <b>hello</b>", "<b>");
echo $foo; // prints "< b>hello" with a hidden "</b>"
strip_tags(), in this case, returns the string it was
supplied, but omits the second and third '<' character. In
a regular browser, it would display the 3 '<' characters,
seperated by spaces: "< < <" (equivalent to "< <
<") followed by a bold hello. Yet since PHP probably
raises a flag after the first "<", all subsequent "<"
characters are ignored until the next ">".
To resume:
Source witSource without strip_tags: "< < <b>hello</b>"
Source with strip_tags: "< b>hello</b>"
hout strip_tags: "< < <b>hello</b>"
Source with strip_tags: "< b>hello</b>"
I would also like to point out:
$foo = strip_tags("< < < >hello</b>", "<b>");
echo $foo;
Source without strip_tags: "< < < >hello</b>"
Source with strip_tags: "hello</b>"
--
Edit bug report at: http://bugs.php.net/?id=12120&edit=1