diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-06-16 04:59:16 +1000 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-06-16 04:59:16 +1000 |
| commit | 370b829460a2ccf0a3fcf614bcd6e4f918f6560e (patch) | |
| tree | d144360d5ee78aa5891c159a65b2f8d21990358f /post.php | |
| parent | ef2e7c616b593e55dcb82b7dc8f2b3b30663ef0e (diff) | |
reCAPTCHA support
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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']); |
