From 370b829460a2ccf0a3fcf614bcd6e4f918f6560e Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 16 Jun 2011 04:59:16 +1000 Subject: reCAPTCHA support --- post.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'post.php') diff --git a/post.php b/post.php index 01ec3898..ec2f6f15 100644 --- a/post.php +++ b/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']); -- cgit v1.3