summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-09-25 16:34:34 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-09-25 16:34:34 +1000
commite089acd1ebc8c5c5d44429b4b4a9fb2345018f29 (patch)
tree6dea76b80296f07eb91b4e3c17a95f7e9092da59
parentd51f6a932e52561e64db81cceb918d12e99cc78b (diff)
Fixed force_body and force_body_op
-rw-r--r--post.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/post.php b/post.php
index 33dcc449..1fc09cfe 100644
--- a/post.php
+++ b/post.php
@@ -246,13 +246,11 @@
elseif(empty($post['body']))
error($config['error']['tooshort_body']);
- if($config['force_body'] && empty($post['body']))
- error($config['error']['tooshort_body']);
-
- if($config['force_body'] && !empty($post['body'])) {
+ if($OP && $config['force_body_op'] || !$OP && $config['force_body']) {
$stripped_whitespace = preg_replace('/[\s]/u', '', $post['body']);
- if(empty($stripped_whitespace))
+ if(empty($stripped_whitespace )) {
error($config['error']['tooshort_body']);
+ }
}
if($post['mod']) {
@@ -317,7 +315,6 @@
if(strlen($post['email']) > 40) error(sprintf($config['error']['toolong'], 'email'));
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($config['force_body_op'] && empty($post['body'])) error($config['error']['tooshort_body']);
if(strlen($post['password']) > 20) error(sprintf($config['error']['toolong'], 'password'));
wordfilters($post['body']);