forked from leftypol/leftypol
post.php: follow max_body_op and min_body_op
This commit is contained in:
parent
4c1ac32bda
commit
f100d8fcda
1 changed files with 8 additions and 5 deletions
11
post.php
11
post.php
|
@ -1232,15 +1232,18 @@ function handle_post()
|
|||
error(sprintf($config['error']['toolong'], 'subject'));
|
||||
}
|
||||
if (!$mod) {
|
||||
$min_body = $post['op'] ? $config['min_body_op'] : $config['min_body'];
|
||||
$max_body = $post['op'] ? $config['max_body_op'] : $config['max_body'];
|
||||
|
||||
$body_mb_len = mb_strlen($post['body']);
|
||||
$is_op = $post['op'];
|
||||
|
||||
if ($body_mb_len > 0 && $body_mb_len < $min_body) {
|
||||
if (($is_op && $config['force_body_op']) || (!$is_op && $config['force_body'])) {
|
||||
$min_body = $is_op ? $config['min_body_op'] : $config['min_body'];
|
||||
|
||||
if ($body_mb_len < $min_body) {
|
||||
error($config['error']['tooshort_body']);
|
||||
}
|
||||
}
|
||||
|
||||
$max_body = $is_op ? $config['max_body_op'] : $config['max_body'];
|
||||
if ($body_mb_len > $max_body) {
|
||||
error($config['error']['toolong_body']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue