Re: Removing security-problematic chars from strings

From: Date: Fri, 21 Nov 2003 18:30:29 +0000
Subject: Re: Removing security-problematic chars from strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170609@lists.php.net to get a copy of this message
Chris Shiflett wrote:
--- "CPT John W. Holmes" <holmes072000@charter.net> wrote:
Heh... my turn to disagree again. You can do a simple str_replace() to convert "&lt;b&gt;" back into "<b>", but you're going to have to do it for each case. Also by doing that blindly, you can end up with orphaned tags affecting the rest of your page (making it all bold, for example).
How does bbcode make this easier or even different?
My only point was that I felt you _did_ need to use regular expression to ensure you're only converting paired tags. Just using str_replace() could leave orphaned tags unless you're keeping a count of what's been replaced. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#170609) next »