note 16446 added to function.htmlspecialchars

From: Date: Wed, 31 Oct 2001 02:44:34 +0000
Subject: note 16446 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-19686@lists.php.net to get a copy of this message
If you store html processed through htmlspecialchar() in your database, you may need to convert it back to real html, but only for the <a href=""></a> tags, to prevent users from posting garbage on your site. Here the command: preg_replace("/\&lt;(a href=)\&quot;(.*?)\&quot;\&gt;(.*?)\&lt;(\/a)\&gt;/i","<\\1\"\\2\">\\3<\\4>",$string); Regexps rule ! -- http://www.php.net/manual/en/function.htmlspecialchars.php http://master.php.net/manage/user-notes.php?action=edit+16446 http://master.php.net/manage/user-notes.php?action=delete+16446 http://master.php.net/manage/user-notes.php?action=reject+16446

« previous php.notes (#19686) next »