But where's the user input? Ah, need another var, say, $in_msg.
And then you want to compare the input with the forbidden words... so you're going to walk the text, with another split (of $in_msg to, say, @suspect and then compare each of your $hotwords with each word in @suspect? (caveat: if you use eq rather than a regex you'll need all the possible VaRIAtions OF cAsE. On the other hand, if you go with a regex (case insensitive, one presumes), please share the construct that matches all your possible prohibitions as :-) I'm not familiar with that one.
And now you have to decide what to do about the offensive words. Are you going to simply replace them with something that's less offensive -- say "XXXX?" Or are you going to send the whole post to the bitbucket? Or someting else? More thought required here.
Also, suppose "free p0rn!" is in your hotwords file but the poster writes "free porn." Now we're dealing not only with enlarging your hotwords dictionary; we may also be having to deal with parsing natural language. And that's hard: suppose the poster is writing to condemn "free porn" (or any other kinds). Do you want that post banned?
Or, just one more before the examples get tedious: Suppose your posted writes "Free Guppies" or some other captive group? What now?
Perhaps you've thought this through before; but if not, it may well be worth your time and trouble to reconsider your distaste for using a module.
In reply to Re: Filtering SPAM hot words from Message Post
by ww
in thread Filtering SPAM hot words from Message Post
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |