blacklist

Blacklist of words on content to filter message [closed]

南楼画角 提交于 2019-11-27 06:30:59
问题 For a website that takes input from kids we need to filter any naughty / bad words that they use when they enter their comments in the website (running PHP). The comments are a free field and users can enter whatever comments they want. The solution I can think of is to have a words list like BLACKLIST: bad,bad,word,woord,craap,craaaap, (We can fill this with all the blacklisted words). Then when the form is saved we can look at the list and if any of the words are present then we will not

How to “Validate” Human Names in CakePHP?

淺唱寂寞╮ 提交于 2019-11-26 23:07:19
I have a PHP script that is supposed to check for "valid" human names, but recently cracked against a name with a space, so we added spaces to our validator. Rather than doing this, is there a way to add a blacklist to CakePHP's validator to block all "invalid" characters, rather than allowing "valid" ones? NOTE: I know how to do this in PHP (generally) but using CakePHP's validator syntax is different. I agree with the other comments that validating a name is probably a bad idea. For virtually everything you can think of to validate, there will be someone with a name that breaks your rule. If

How to “Validate” Human Names in CakePHP?

大兔子大兔子 提交于 2019-11-26 08:36:07
问题 I have a PHP script that is supposed to check for \"valid\" human names, but recently cracked against a name with a space, so we added spaces to our validator. Rather than doing this, is there a way to add a blacklist to CakePHP\'s validator to block all \"invalid\" characters, rather than allowing \"valid\" ones? NOTE: I know how to do this in PHP (generally) but using CakePHP\'s validator syntax is different. 回答1: I agree with the other comments that validating a name is probably a bad idea