对于接受儿童输入的网站,我们需要过滤他们在网站(运行 PHP)中输入评论时使用的任何顽皮/坏词.
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).
评论是一个自由字段,用户可以输入他们想要的任何评论.我能想到的解决方案是有一个单词列表黑名单:bad,bad,word,wood,craap,craaaap,(我们可以用所有列入黑名单的词来填充).
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 allow the comment to be saved.
但是这种方法的问题是他们可以通过在单词上添加字母来绕过过滤器 EG:shiiiiit
BUT the prolem with this method is that they can get around by adding letters to the words to make it skip the filter EG: shiiiiit
让我知道您认为为这些词创建过滤器的最佳方法是什么.
Let me know what you think is the best way to create some filter for these words.
您永远无法过滤每个排列.也许最可行的解决方案是过滤明显的内容,并实施报告滥用"机制,以便有人可以手动查看(并拒绝)可疑评论.
You're never going to be able to filter every permutation. Perhaps the most feasible solution is to filter the obvious, and implement a "Report Abuse" mechanism so someone can manually look over (and reject) suspect comments.
这篇关于内容上的单词黑名单以过滤消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
以编程方式将可下载文件添加到 Woocommerce 产品Add programmatically a downloadable file to Woocommerce products(以编程方式将可下载文件添加到 Woocommerce 产品)
获取今天 Woocommerce 中每种产品的总订单数Get today#39;s total orders count for each product in Woocommerce(获取今天 Woocommerce 中每种产品的总订单数)
在 WooCommerce 和电话字段验证问题中添加自定义注Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和电话字段验证问题中添加自定义注册字段
在 Woocommerce 简单产品中添加一个将更改价格的选Add a select field that will change price in Woocommerce simple products(在 Woocommerce 简单产品中添加一个将更改价格的选择字段)
在 WooCommerce 3 中将自定义列添加到管理产品列表Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中将自定义列添加到管理产品列表)
自定义结帐“下订单"按钮输出htmlCustomizing checkout quot;Place Orderquot; button output html(自定义结帐“下订单按钮输出html)