Stopping Link Spam in Coppermine Galleries
Something I noticed lately is that most spam comments in Coppermine Galleries contain links. An easy way to block this type of spam (when they get past CAPTCHA which you should also have) is to add the following code in your db_input.php file:
After:
Insert:
Not entirely sure why Coppermine doesn't make this a feature to begin with, though some forum searching suggests that the devs strongly believe this method ineffective.
After:
Code:
check_comment($msg_body);
check_comment($msg_author);
Insert:
Code:
if (strpos($msg_body, "http://")!==false
|| strpos($msg_body, "[url=http://")!==false
|| strpos($msg_body, "[/url]")!==false) {
if ($CONFIG['log_mode'] != 0) {
log_write('Comment blocked due to URL: '.$msg_body.' by ' .
$hdr_ip,
CPG_SECURITY_LOG);
}
cpg_die(ERROR, "No links in comments please!",
__FILE__, __LINE__);
}
Not entirely sure why Coppermine doesn't make this a feature to begin with, though some forum searching suggests that the devs strongly believe this method ineffective.
1653 unique view(s)