You are here: Re: open html tags « HTML « IT news, forums, messages
Re: open html tags

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 &lt;.
>
> --
> Steven

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация