From fd42eae329e01a1f592d433583ef9e528d6bd031 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 8 Jun 2023 12:55:32 +0700 Subject: [PATCH] Maked max post length configurable (#793) --- library/ajax/posts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/ajax/posts.php b/library/ajax/posts.php index 2e55eb265..1c840bbd0 100644 --- a/library/ajax/posts.php +++ b/library/ajax/posts.php @@ -94,7 +94,7 @@ switch ($this->request['type']) { if ($post['post_id'] == $post['topic_first_post_id']) { $message = "[quote]" . $post['topic_title'] . "[/quote]\r"; } - if (mb_strlen($message, 'UTF-8') > 1000) { + if (mb_strlen($message, 'UTF-8') > $bb_cfg['max_post_length']) { $this->response['redirect'] = make_url(POSTING_URL . '?mode=quote&p=' . $post_id); } @@ -121,7 +121,7 @@ switch ($this->request['type']) { if ($post['poster_id'] != $userdata['user_id'] && !$is_auth['auth_mod']) { $this->ajax_die($lang['EDIT_OWN_POSTS']); } - if ((mb_strlen($post['post_text'], 'UTF-8') > 1000) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) { + if ((mb_strlen($post['post_text'], 'UTF-8') > $bb_cfg['max_post_length']) || $post['post_attachment'] || ($post['topic_first_post_id'] == $post_id)) { $this->response['redirect'] = make_url(POSTING_URL . '?mode=editpost&p=' . $post_id); } elseif ($this->request['type'] == 'editor') { $text = (string)$this->request['text'];