Re: UDF Inspection, #2

2006-11-30 Thread Tom Chiverton
On Wednesday 29 November 2006 18:00, Rick Root wrote: But I'm not trying to eliminate HTML markup from HTML emails.. I'd prefer to actually show the HTML. That's why I said sanitize Ahh. And by sanitize I mean removing unfriendly HTML tags like EMBED, OBJECT, APPLET, IFRAME, etc.. and

UDF Inspection, #2

2006-11-29 Thread Rick Root
Okay.. since there's really no good way to use regular expressions to strip HTML attributes that may contain javascript... I decided to write a UDF that detects possible javacript in user published content. For example, if you allow users to enter anchor tags, you need to prevent them from

Re: UDF Inspection, #2

2006-11-29 Thread Rick Root
found one bug already the regex should be as follows, since all HTML tags start with an alpha but *CAN* contain numbers.. ie, h1-h5... loc = REFindNoCase([A-Z][A-Z0-9]*\s+[^]*#att#=.*?,str); In english... find any tag that starts with a letter and is followed by zero or more

Re: UDF Inspection, #2

2006-11-29 Thread Tom Chiverton
On Wednesday 29 November 2006 15:21, Rick Root wrote: found one bug already the regex should be as follows, since all HTML tags start with an alpha but *CAN* contain numbers.. ie, h1-h5... I didn't see the start of the thread, so this may have been addressed - but why are you letting your

Re: UDF Inspection, #2

2006-11-29 Thread Rick Root
Tom Chiverton wrote: I didn't see the start of the thread, so this may have been addressed - but why are you letting your users enter HTML ? That's not the sole purpose. In fact, I'm trying to sanitize HTML emails being viewed in a webmail application. Either give them a WYSIWYG DHTML

Re: UDF Inspection, #2

2006-11-29 Thread Tom Chiverton
On Wednesday 29 November 2006 16:28, Rick Root wrote: I didn't see the start of the thread, so this may have been addressed - but why are you letting your users enter HTML ? That's not the sole purpose. In fact, I'm trying to sanitize HTML emails being viewed in a webmail application. Ahh.

Re: UDF Inspection, #2

2006-11-29 Thread Rick Root
Tom Chiverton wrote: On Wednesday 29 November 2006 16:28, Rick Root wrote: That's not the sole purpose. In fact, I'm trying to sanitize HTML emails being viewed in a webmail application. Ahh. Most HTML emails contain a plain text part, as I'm sure you know, but a good start with HTML