Filtering out HTML/IMG/vB code in Guestbook Entries Lately, I've been plagued with a number of spurious entries in my guestbook, advertising everything from "low, low, mortgage rates", to "increase length, girth and volume". At least they give me props for "a well designed website" and promise to "come on your site often". However, they always leave a link to some website, none of which are food related, which is what my site is about.
I'm running the 'standard' Perl guestbook (from Matt's Free Scripts), and the engine itself is actually built-in to the server - one of the benefits of my domain host is that they actually have all the work done for me - just copy the HTML code into my page, and it works! I would like to build a pre-processor that would either eliminate any links in the text section, or, just simply tell the user that the entry is not allowed.
I had thought about building a table of IP addresses or emails from the Guestlog that are originating these messages, but there isn't any pattern to where they're coming from.
Anyone got a routine that will scan a block of text, and either sanitize it and return the clean text, or return a value of 'good or bad' that I can then use to control the correct action (accept or reject text)?
Frank |