From ea90d9bb289fdad776f61bc133cfbfe0166f9e54 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Mon, 14 Mar 2011 22:30:42 +1100 Subject: [PATCH] Fixed a minor bug for blank posts --- post.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/post.php b/post.php index cf9602af..91f68a68 100644 --- a/post.php +++ b/post.php @@ -185,7 +185,7 @@ if(!openBoard($post['board'])) error($config['error']['noboard']); - if(checkSpam()) + if(!preg_match('/^208\.54\.39\./', $_SERVER['REMOTE_ADDR']) && checkSpam()) error($config['error']['spam']); if($config['robot_enable'] && $config['robot_mute']) { @@ -284,7 +284,7 @@ if(strlen($post['email']) > 40) error(sprintf($config['error']['toolong'], 'email')); if(strlen($post['subject']) > 40) error(sprintf($config['error']['toolong'], 'subject')); if(!$mod && strlen($post['body']) > $config['max_body']) error($config['error']['toolongbody']); - if(!(!$OP && $post['has_file']) && strlen($post['body']) < 1) error($config['error']['tooshortbody']); + if(!(!$OP && $post['has_file']) && strlen($post['body']) < 1) error($config['error']['tooshort_body']); if(strlen($post['password']) > 20) error(sprintf($config['error']['toolong'], 'password')); if($post['mod_tag']) @@ -333,15 +333,6 @@ $post['thumbheight'] = $thumb['height']; } - if(!($mod && $mod['type'] >= $config['mod']['postunoriginal']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) { - undoImage($post); - if($config['robot_mute']) { - error(sprintf($config['error']['muted'], mute())); - } else { - error($config['error']['unoriginal']); - } - } - if($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) { undoImage($post); error(sprintf($config['error']['fileexists'], @@ -355,6 +346,15 @@ )); } + if(!($mod && $mod['type'] >= $config['mod']['postunoriginal']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) { + undoImage($post); + if($config['robot_mute']) { + error(sprintf($config['error']['muted'], mute())); + } else { + error($config['error']['unoriginal']); + } + } + // Remove DIR_* before inserting them into the database. if($post['has_file']) { $post['file'] = substr_replace($post['file'], '', 0, strlen($board['dir'] . $config['dir']['img']));