Quantcast
Viewing all articles
Browse latest Browse all 8245

chafik73 on "Anti-spam: How to restrict characters on comments to Arabic characters only?"

Hi
Before swiching to WP, I had a simple web site with a comment scripts called commentics
The website being in Arabic, I used a simple technique to fight spam which was 100%
It is a code to makes sure that there is at least one Arabic character:

function comment_check_arabic ($comment) { //checks whether comment is arabic

if (!preg_match("/\p{Arabic}/u", $comment)) {
    error("The comment entered is not Arabic. Please write it in Arabic.");
}

} //end of comment-check-arabic function

How can do the same thing in WP ?


Viewing all articles
Browse latest Browse all 8245

Trending Articles