|
Posted by ffreino on 09/25/07 11:04
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
On 25 sep, 08:20, Steven Saunderson <phe...@Syd.au> wrote:
> On Mon, 24 Sep 2007 16:42:07 -0400, Harlan Messinger
>
> <hmessinger.removet...@comcast.net> wrote:
> > Steven Saunderson wrote:
> > > Assuming that HTML comments are not allowed inside tags could you try
> > > putting <!-- > --> after the user input. This should fix an open tag
> > > but not necessarily an open element.
>
> > Is that effective when there's an open single or double quote delimiting
> > an attribute value?
>
> Good point; it probably won't work. I suppose the OP will have to
> validate everything or change all < to <.
>
> --
> Steven
[Back to original message]
|