post.php: load config earlier

This commit is contained in:
czaks 2014-04-18 14:32:05 +02:00
parent df077197bb
commit 8e9db69375

View File

@ -149,6 +149,10 @@ if (isset($_POST['delete'])) {
} elseif (isset($_POST['post'])) { } elseif (isset($_POST['post'])) {
if (!isset($_POST['body'], $_POST['board'])) if (!isset($_POST['body'], $_POST['board']))
error($config['error']['bot']); error($config['error']['bot']);
// Check if board exists
if (!openBoard($post['board']))
error($config['error']['noboard']);
if (!isset($_POST['name'])) if (!isset($_POST['name']))
$_POST['name'] = $config['anonymous']; $_POST['name'] = $config['anonymous'];
@ -172,7 +176,7 @@ if (isset($_POST['delete'])) {
$post['thread'] = round($_POST['quick-reply']); $post['thread'] = round($_POST['quick-reply']);
} else } else
$post['op'] = true; $post['op'] = true;
if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) || if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) ||
(!$post['op'] && $_POST['post'] == $config['button_reply']))) (!$post['op'] && $_POST['post'] == $config['button_reply'])))
error($config['error']['bot']); error($config['error']['bot']);
@ -184,10 +188,6 @@ if (isset($_POST['delete'])) {
checkDNSBL(); checkDNSBL();
// Check if board exists
if (!openBoard($post['board']))
error($config['error']['noboard']);
// Check if banned // Check if banned
checkBan($board['uri']); checkBan($board['uri']);