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;