summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorBui <bui@bui.pm>2014-10-06 19:35:37 +0900
committerczaks <marcin@6irc.net>2014-10-07 00:15:45 +0200
commitcb9b4db73d332cd7f82adf7aea406f013d626828 (patch)
tree84f5a31dddad225a936056b2c51c2813e603dda2 /post.php
parentaba8d27ace9b1b95bb7cc71ae0424f0bc8f20809 (diff)
do security checks *after* checking captcha
Diffstat (limited to 'post.php')
-rw-r--r--post.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/post.php b/post.php
index 2763d4d3..223ddd45 100644
--- a/post.php
+++ b/post.php
@@ -187,20 +187,6 @@ if (isset($_POST['delete'])) {
} else
$post['op'] = true;
- if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) ||
- (!$post['op'] && $_POST['post'] == $config['button_reply'])))
- error($config['error']['bot']);
-
- // Check the referrer
- if ($config['referer_match'] !== false &&
- (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], rawurldecode($_SERVER['HTTP_REFERER']))))
- error($config['error']['referer']);
-
- checkDNSBL();
-
- // Check if banned
- checkBan($board['uri']);
-
// 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']))
@@ -214,7 +200,21 @@ if (isset($_POST['delete'])) {
error($config['error']['captcha']);
}
}
+
+ if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) ||
+ (!$post['op'] && $_POST['post'] == $config['button_reply'])))
+ error($config['error']['bot']);
+
+ // Check the referrer
+ if ($config['referer_match'] !== false &&
+ (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], rawurldecode($_SERVER['HTTP_REFERER']))))
+ error($config['error']['referer']);
+ checkDNSBL();
+
+ // Check if banned
+ checkBan($board['uri']);
+
if ($post['mod'] = isset($_POST['mod']) && $_POST['mod']) {
require 'inc/mod/auth.php';
if (!$mod) {