Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Regex to find deliberate HTML errors


Message #1 by "Chris Ralph" <webmaster@g...> on Thu, 13 Feb 2003 04:56:56
How about working on some kind of adaptation of this..

http://www.hotscripts.com/Detailed/8438.html

Justin

> -----Original Message-----
> From: Paul [mailto:paul@d...]
> Sent: 13 February 2003 09:14
> To: professional php
> Subject: [pro_php] Re: Regex to find deliberate HTML errors
> 
> 
> Maybe the code for the HTML validator is available. 
>  http://validator.w3.org/  I know it checks attributes.
> 
> Chris Ralph wrote:
> 
> >Hi,
> >I need to stop people from entering HTML like this:
> ><font bdo dir=rtl
> ><marquee img src="http://www.site.com/image.gif"
> >
> >Basically I allow certain HTML tags, but due to the way some 
> browsers 
> >parse tags and the fact I don't test attributes, people can 
> get around 
> >limitations by opening a legitimate tag and adding other tags as 
> >attributes..
> >
> >Basically what I want to be able to do is test any tag for 
> any number of 
> >any type of attributes.. (it could have no attributes, it 
> could have 6 
> >different attributes)
> >
> >Once I can find a regex to pick out all the attributes from 
> a tag, I can 
> >test to see whether or not they're allowed to be used...
> >
> >(Before you ask, banning all HTML isn't an option)..
> >
> >Regards,
> >Chris
> >  
> >
> 
> 
> 

  Return to Index