From 78e17eb4e512cecdae12d08bb4fc3186fddb72b0 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 3 Jul 2019 02:03:32 +0200 Subject: [PATCH] Made post content checks slightly stricter. --- src/Forum/validate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forum/validate.php b/src/Forum/validate.php index 2d9dc2f1..5c0a6ba9 100644 --- a/src/Forum/validate.php +++ b/src/Forum/validate.php @@ -5,7 +5,7 @@ define('MSZ_POST_TEXT_LENGTH_MIN', 1); define('MSZ_POST_TEXT_LENGTH_MAX', 60000); function forum_validate_title(string $title): string { - $length = mb_strlen($title); + $length = mb_strlen(trim($title)); if($length < MSZ_TOPIC_TITLE_LENGTH_MIN) { return 'too-short'; @@ -19,7 +19,7 @@ function forum_validate_title(string $title): string { } function forum_validate_post(string $text): string { - $length = mb_strlen($text); + $length = mb_strlen(trim($text)); if($length < MSZ_POST_TEXT_LENGTH_MIN) { return 'too-short';