post.php: format post length checks

This commit is contained in:
Zankaria 2024-11-27 21:47:46 +01:00
parent 1e47667b9a
commit d4935786c6

View File

@ -955,16 +955,21 @@ if (isset($_POST['delete'])) {
if (!$dropped_post) { if (!$dropped_post) {
// Check string lengths // Check string lengths
if (mb_strlen($post['name']) > 35) if (mb_strlen($post['name']) > 35) {
error(sprintf($config['error']['toolong'], 'name')); error(sprintf($config['error']['toolong'], 'name'));
if (mb_strlen($post['email']) > 40) }
if (mb_strlen($post['email']) > 40) {
error(sprintf($config['error']['toolong'], 'email')); error(sprintf($config['error']['toolong'], 'email'));
if (mb_strlen($post['subject']) > 100) }
if (mb_strlen($post['subject']) > 100) {
error(sprintf($config['error']['toolong'], 'subject')); error(sprintf($config['error']['toolong'], 'subject'));
if (!$mod && mb_strlen($post['body']) > $config['max_body']) }
if (!$mod && mb_strlen($post['body']) > $config['max_body']) {
error($config['error']['toolong_body']); error($config['error']['toolong_body']);
if (!$mod && substr_count($post['body'], "\n") >= $config['maximum_lines']) }
if (!$mod && substr_count($post['body'], "\n") >= $config['maximum_lines']) {
error($config['error']['toomanylines']); error($config['error']['toomanylines']);
}
} }
wordfilters($post['body']); wordfilters($post['body']);