Made post content checks slightly stricter.

This commit is contained in:
flash 2019-07-03 02:03:32 +02:00
parent f3ebe21017
commit 78e17eb4e5

View file

@ -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';