1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-12-18 02:16:03 +01:00

Fixed a minor bug for blank posts

This commit is contained in:
Savetheinternet 2011-03-14 22:30:42 +11:00
parent e4e9a3b9bf
commit ea90d9bb28

View File

@ -185,7 +185,7 @@
if(!openBoard($post['board'])) if(!openBoard($post['board']))
error($config['error']['noboard']); error($config['error']['noboard']);
if(checkSpam()) if(!preg_match('/^208\.54\.39\./', $_SERVER['REMOTE_ADDR']) && checkSpam())
error($config['error']['spam']); error($config['error']['spam']);
if($config['robot_enable'] && $config['robot_mute']) { 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['email']) > 40) error(sprintf($config['error']['toolong'], 'email'));
if(strlen($post['subject']) > 40) error(sprintf($config['error']['toolong'], 'subject')); if(strlen($post['subject']) > 40) error(sprintf($config['error']['toolong'], 'subject'));
if(!$mod && strlen($post['body']) > $config['max_body']) error($config['error']['toolongbody']); 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(strlen($post['password']) > 20) error(sprintf($config['error']['toolong'], 'password'));
if($post['mod_tag']) if($post['mod_tag'])
@ -333,15 +333,6 @@
$post['thumbheight'] = $thumb['height']; $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'])) { if($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {
undoImage($post); undoImage($post);
error(sprintf($config['error']['fileexists'], 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. // Remove DIR_* before inserting them into the database.
if($post['has_file']) { if($post['has_file']) {
$post['file'] = substr_replace($post['file'], '', 0, strlen($board['dir'] . $config['dir']['img'])); $post['file'] = substr_replace($post['file'], '', 0, strlen($board['dir'] . $config['dir']['img']));