Fixed force_body and force_body_op

This commit is contained in:
Savetheinternet 2011-09-25 16:34:34 +10:00
parent d51f6a932e
commit e089acd1eb

View File

@ -246,14 +246,12 @@
elseif(empty($post['body'])) elseif(empty($post['body']))
error($config['error']['tooshort_body']); error($config['error']['tooshort_body']);
if($config['force_body'] && empty($post['body'])) if($OP && $config['force_body_op'] || !$OP && $config['force_body']) {
error($config['error']['tooshort_body']);
if($config['force_body'] && !empty($post['body'])) {
$stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']); $stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']);
if(empty($stripped_whitespace)) if(empty($stripped_whitespace )) {
error($config['error']['tooshort_body']); error($config['error']['tooshort_body']);
} }
}
if($post['mod']) { if($post['mod']) {
require 'inc/mod.php'; require 'inc/mod.php';
@ -317,7 +315,6 @@
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']) > 100) error(sprintf($config['error']['toolong'], 'subject')); if(strlen($post['subject']) > 100) error(sprintf($config['error']['toolong'], 'subject'));
if(!$mod && strlen($post['body']) > $config['max_body']) error($config['error']['toolong_body']); if(!$mod && strlen($post['body']) > $config['max_body']) error($config['error']['toolong_body']);
if($config['force_body_op'] && empty($post['body'])) 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'));
wordfilters($post['body']); wordfilters($post['body']);