From bb59e907b18d1137aa1ea93348fab47181f9eb59 Mon Sep 17 00:00:00 2001 From: RealAngeleno Date: Sat, 20 May 2023 15:38:40 -0700 Subject: [PATCH] allow posts to be discarded for too many lines --- post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 01a4d80c..f14d55b7 100644 --- a/post.php +++ b/post.php @@ -728,8 +728,10 @@ if (isset($_POST['delete'])) { error(sprintf($config['error']['toolong'], 'email')); if (mb_strlen($post['subject']) > 100) error(sprintf($config['error']['toolong'], 'subject')); - if (!$mod && mb_strlen($post['body']) > $config['max_body']) + if (!$mod && substr_count($post['body']) > $config['max_body']) error($config['error']['toolong_body']); + if (!$mod && substr_count($post['body'], "\n") >= $config['max_lines']) + error($config['error']['toomanylines']); if (mb_strlen($post['password']) > 20) error(sprintf($config['error']['toolong'], 'password')); }