note 32667 added to function.strip-tags
| From: | matt at rack1 dot php dot net | Date: | Wed, 04 Jun 2003 04:42:33 +0000 |
| Subject: | note 32667 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-49684@lists.php.net to get a copy of this message | ||
ryland at ryland dot net
had a nice simple function to remove all tags except the basics and strip any attributes besides
href from inside an <a> tag.
problem with his version is that it can be easily fooled by case
<A href="http://somesite.com"
onClick="alert("alert");">click me</a>
would not be modified because ereg_replace is case sensitive.
also,
<a hRef=....
would have the same effect.
use eregi_replace instead and it seems to work fine.
matt
----
Manual Page -- http://www.php.net/manual/en/function.strip-tags.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32667
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32667&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32667&report=yes