note 82937 added to function.strip-tags

From: Date: Fri, 02 May 2008 19:31:41 +0000
Subject: note 82937 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-139002@lists.php.net to get a copy of this message
Allowing user HTML while preventing XSS is non-trivial. Don't just try to hack together a regexp for it; at very least, check your solution against all of the ha.ckers.org exploit examples: http://ha.ckers.org/xss.html Really, though, you should be using a solid library that recognizes tags, attributes, and styles from a whitelist and rebuilds the markup from scratch. HTMLPurifier has a "linkify" option that does what you're looking for. http://htmlpurifier.org ---- Server IP: 208.69.120.35 Probable Submitter: 65.44.120.114 ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- https://master.php.net/note/edit/82937 Del: integrated -- https://master.php.net/note/delete/82937/integrated Del: useless -- https://master.php.net/note/delete/82937/useless Del: bad code -- https://master.php.net/note/delete/82937/bad+code Del: spam -- https://master.php.net/note/delete/82937/spam Del: non-english -- https://master.php.net/note/delete/82937/non-english Del: in docs -- https://master.php.net/note/delete/82937/in+docs Del: other reasons-- https://master.php.net/note/delete/82937 Reject -- https://master.php.net/note/reject/82937 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139002) next »