Bug #17099: strip_tags() not just stripping out HTML-tags

From: Date: Wed, 08 May 2002 14:50:11 +0000
Subject: Bug #17099: strip_tags() not just stripping out HTML-tags
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7248@lists.php.net to get a copy of this message
From: yves@fuifbeest.com Operating system: Unix/Apache PHP version: 4.2.0 PHP Bug Type: Strings related Bug description: strip_tags() not just stripping out HTML-tags I've made a PHP-based forum and some of the users found out that if they were putting text between < or > (HTML &lt; and &gt; ), this text was lost... Browsing through the source-code and a little tests later, I found out it was strip_tags() causing the problem... strip_tags() is described as "stripping out all HTML- and PHP-tags", so I thought this was a nice way to prevent users from making some sort of childish color-book with images, color-text, etc. in between of the serious posts... Now it appears that strip_tags() strips out ANYTHING in an string between < and > (the hTML fishing-hooks, sorry for mentioning all the time, but I don't if you're seeing them), so that's rather inconvenient I thought... Wouldn't it be possible that PHP has an internal list of all HTML-tags (maybe it has already) and that it should just stripout what a web-browser would interpret as a HTML-tag? Ex.: <?php echo strip_tags("blabla < yieha > blabla"); ?> This will return "blabla blabla"... -- Edit bug report at http://bugs.php.net/?id=17099&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17099&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17099&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17099&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17099&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17099&r=support Expected behavior: http://bugs.php.net/fix.php?id=17099&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17099&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17099&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17099&r=globals

« previous php.bugs (#7248) next »