Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Parse URL field on submission

Quote Reply
Parse URL field on submission
Howdy guys!

I have spent about 1hr searching and browsing these forums in the hopes that I did not have to bother anyone :P Alas, I have failed in my searching haha. Im sure what Im after isn't "difficult" (for perl gurus anyways...), but since I have no clue about PERL or regex, I have no clue what to do. I'd like to parse the url field on submission so that any folder index page is allowed, but any "non-index" page is blocked. For example:

GOOD submits
somedomain.com/site01/
somedomain.com/site01/index.htm
somedomain.com/site01/index.html

BAD submits
somedomain.com/site01/index21.html
somedomain.com/site01/anotherspamsubmission.html

Im thinking along the lines of:

a) must end in a / character AND not have a period character (.) within 4 chars previous to slash (ie: spamsubmit.html/ would not be acceptable)
OR
b) must end in "/index.html"
OR
c) must end in "/index.htm"

Im aware that this logic sequence is not conclusive (php, shtml etc...), however for what Im running and needing to do, it would run perfectly well.

Is there something I should add to links def for the URL field definition? Is there something I can add into the add.cgi script to parse each submission and enforce this rule? Is what Im asking excessively painful?

Thanks for your time guys ;)

Cheers,
Amar