note 61287 added to function.strip-tags

From: Date: Mon, 30 Jan 2006 13:42:30 +0000
Subject: note 61287 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-102726@lists.php.net to get a copy of this message
I think the Regular expression posted <a href=function.strip-tags.php#51383>HERE</a> is not correct <?php $disalowedtags = array("font"); foreach ($_GET as $varname) foreach ($disalowedtags as $tag) ---------------------------------------------------------- if (eregi("<[^>]*".$tag."*\"?[^>]*>", $varname)) <--- ---------------------------------------------------------- die("stop that"); ?> this function also replaces links like this : <a href=font.php>test</a> because word "font" is between tags "<" ">". I changed reg exp with this ----------------------------------------------------- if (eregi("(<|</)".$tag."*\"?[^>]*>", $varname)) ----------------------------------------------------- bye Luca ---- Server IP: 213.92.11.19 Probable Submitter: 194.185.248.130 ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61287 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61287&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61287&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102726) next »