From 3df526d5b5a5fb381950f45e5be4b6c253388a07 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 1 Jun 2026 13:54:02 +0200 Subject: [PATCH] Update article-validator.php --- php/validator/article-validator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/php/validator/article-validator.php b/php/validator/article-validator.php index 2eb1dbc..02c4f94 100644 --- a/php/validator/article-validator.php +++ b/php/validator/article-validator.php @@ -3,6 +3,7 @@ * Prüft, ob der Autor auch der Eigentümer des Beitrags ist. * @param $author * @return true + * TODO: Implement this. */ function articleAuthorValidator($author) { @@ -21,6 +22,7 @@ function articleAuthorValidator($author) */ function articleTitleValidator($title) { + $title = trim($title); $titlePattern = '/^[a-zA-Z0-9äöüÄÖÜß\s.,!?:;()\'"„“«»_+-]{5,120}$/u'; if (preg_match($titlePattern, $title)) { return true; @@ -36,8 +38,9 @@ function articleTitleValidator($title) */ function articleContentValidator($content) { + $content = trim($content); $zeichenAnzahl = mb_strlen($content); - if ($zeichenAnzahl <= 7000 && $zeichenAnzahl > 10) { + if ($zeichenAnzahl <= 7000 && $zeichenAnzahl >= 10) { return true; }else{ return false;