forked from leftypol/leftypol
reCAPTCHA support
This commit is contained in:
parent
ef2e7c616b
commit
370b829460
9 changed files with 392 additions and 7 deletions
14
post.php
14
post.php
|
@ -183,6 +183,20 @@
|
|||
if(!openBoard($post['board']))
|
||||
error($config['error']['noboard']);
|
||||
|
||||
// Check for CAPTCHA right after opening the board so the "return" link is in there
|
||||
if($config['recaptcha']) {
|
||||
if(!isset($_POST['recaptcha_challenge_field']) || !isset($_POST['recaptcha_response_field']))
|
||||
error($config['error']['bot']);
|
||||
// Check what reCAPTCHA has to say...
|
||||
$resp = recaptcha_check_answer($config['recaptcha_private'],
|
||||
$_SERVER['REMOTE_ADDR'],
|
||||
$_POST['recaptcha_challenge_field'],
|
||||
$_POST['recaptcha_response_field']);
|
||||
if(!$resp->is_valid) {
|
||||
error($config['error']['captcha']);
|
||||
}
|
||||
}
|
||||
|
||||
if(checkSpam())
|
||||
error($config['error']['spam']);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue