RE: [PHP] preg_replace (again) [solved]

From: Date: Wed, 20 Sep 2006 07:13:22 +0000
Subject: RE: [PHP] preg_replace (again) [solved]
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-241966@lists.php.net to get a copy of this message
On Wed, 2006-09-20 at 11:45 +0700, Peter Lauri wrote: > Just to share my solution: Out of curiosity, why don't you go with the very well known BBCode system? > preg_replace('/_color:(.*?)_(.*?)_color_/i', '<font > color="$1">$2</font>', > $html); Hopefully this is a private system, otherwise someone not very nice might do the following: ---- This is some _color:pink"> <script type="text/javascript" language="javascript"> document.location = 'http://www.myDoityPr0nCollection.com'; </script><font color="pink_ colored text _color_ that I want to transfer ---- You need better content sanitization ]:B FWIW, the <font> tag is about as deprecated as deprecated can get. You might consider switching to <span>. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#241966) next »