开发者

How to define custom filter to block spam in Drupal

开发者 https://www.devze.com 2023-02-22 10:57 出处:网络
Drupal has a nice spam module with a lot of features, including defining Custom filters. The filters can be either Plain text or Regular expressions. I am a bit familiar with regexp but not sure how t

Drupal has a nice spam module with a lot of features, including defining Custom filters. The filters can be either Plain text or Regular expressions. I am a bit familiar with regexp but not sure how to define regexps in spam module in order to block any occurrences of spam strings like

myblablaviagra.com

or phone numbers like:

091234567

The thing that I am really not sure of is that whether the regex need to开发者_运维百科 be enclosed in '/ /' or something else. Unfortunately I could not find any examples of custom regex filter in action, hence the question.


According to the docs, you can define a literal string that is matched "verbatim" using quotes 'myblablaviagra.com', or a regex using delimiters /^\d+$/ (standard Perl re syntax).

0

精彩评论

暂无评论...
验证码 换一张
取 消