|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-08 11:52 UTC] jimw@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Mar 24 05:00:02 2026 UTC |
I've made a PHP-based forum and some of the users found out that if they were putting text between < or > (HTML < and > ), 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"...