note 85291 added to function.strip-tags
| From: | LiamMorland at osu1 dot php dot net | Date: | Sun, 24 Aug 2008 00:58:56 +0000 |
| Subject: | note 85291 added to function.strip-tags | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143779@lists.php.net to get a copy of this message | ||
Here is a suggestion for getting rid of attributes: After you run your HTML through strip_tags(),
use the DOM interface to parse the HTML. Recursively walk through the DOM tree and remove any
unwanted attributes. Serialize the DOM back to the HTML string.
Don't make the default permit mistake: Make a list of the attributes you want to ALLOW and
remove any others, rather than removing a specific list, which may be missing something important.
----
Server IP: 66.207.199.35
Probable Submitter: 70.49.41.159
----
Manual Page -- http://www.php.net/manual/en/function.strip-tags.php
Edit -- https://master.php.net/note/edit/85291
Del: integrated -- https://master.php.net/note/delete/85291/integrated
Del: useless -- https://master.php.net/note/delete/85291/useless
Del: bad code -- https://master.php.net/note/delete/85291/bad+code
Del: spam -- https://master.php.net/note/delete/85291/spam
Del: non-english -- https://master.php.net/note/delete/85291/non-english
Del: in docs -- https://master.php.net/note/delete/85291/in+docs
Del: other reasons-- https://master.php.net/note/delete/85291
Reject -- https://master.php.net/note/reject/85291
Search -- https://master.php.net/manage/user-notes.php