Blabberbox » Stopping Link Spam in Coppermine GalleriesShare on Twitter

Stopping Link Spam in Coppermine Galleries

August 3rd, 2013 | Posted by pftq in Blabberbox | #
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:
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.
1646 unique view(s)

Leave a Comment

Name: (Have an account? Login or Register)
Email: (Won't be published)
Website: (Optional)
Comment:
Enter the code from image: