#38967 [Opn->Csd]: strip_tags doesn't remove attributes completely
| From: | felipe@php.net | Date: | Tue, 19 Feb 2008 00:44:11 +0000 |
| Subject: | #38967 [Opn->Csd]: strip_tags doesn't remove attributes completely | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-122439@lists.php.net to get a copy of this message | ||
ID: 38967
Updated by: felipe@php.net
Reported By: corinl at gmx dot de
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: linux
PHP Version: 5.1.6
New Comment:
This seems be fixed... At least, it doesn't occur in 5.2.6.
Previous Comments:
------------------------------------------------------------------------
[2006-09-26 22:41:29] corinl at gmx dot de
Description:
------------
when a tag attribute contains a <, it does not get removed properly.
Reproduce code:
---------------
<?
$s = <<<EOT
nothing should be between this - <img
src="http://static.flickr.com/105/253610807_10f90540d3.jpg?v=0"
alt=""
style="max-width:50px;width:expression(this.width>50?50:true);"></img> -
and this.
EOT;
echo($s);
echo('<hr>');
echo('original: '.htmlentities($s));
echo('<hr>');
echo('stripped: '.htmlentities(strip_tags($s)));
?>
Expected result:
----------------
stripped: nothing should be between this - - and this.
Actual result:
--------------
stripped: nothing should be between this - 50?50:true);"> - and this.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38967&edit=1