|
Posted by Neredbojias on 09/26/07 07:12
Well bust mah britches and call me cheeky, on Tue, 25 Sep 2007 11:04:57
GMT scribed:
> Ok, I'll try to focus my problem ;)
> When an user posts a message, I use php function 'strip_tags' to allow
> only some tags.
>
> strip_tags($text, '<b><i><u><br><a><q><image>')
>
> I think I could use regex to close open tags but I would like to try
> something easier. Moreover, I must check open quotes and so on.
> I would like to try something easier and faster (and probably
> worse) :)
> I think I'll have to choose the hard and long way
You'd be better off working from the other direction: change all input to
text, then html-ize only those tags you want. I just got through doing a
whole bunch of this stuff and it isn't particularly that bad. However,
regex expressions are definitely a boon to the endeavor.
--
Neredbojias
Half lies are worth twice as much as whole lies.
[Back to original message]
|