Update article-validator.php
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
* Prüft, ob der Autor auch der Eigentümer des Beitrags ist.
|
* Prüft, ob der Autor auch der Eigentümer des Beitrags ist.
|
||||||
* @param $author
|
* @param $author
|
||||||
* @return true
|
* @return true
|
||||||
|
* TODO: Implement this.
|
||||||
*/
|
*/
|
||||||
function articleAuthorValidator($author)
|
function articleAuthorValidator($author)
|
||||||
{
|
{
|
||||||
@@ -21,6 +22,7 @@ function articleAuthorValidator($author)
|
|||||||
*/
|
*/
|
||||||
function articleTitleValidator($title)
|
function articleTitleValidator($title)
|
||||||
{
|
{
|
||||||
|
$title = trim($title);
|
||||||
$titlePattern = '/^[a-zA-Z0-9äöüÄÖÜß\s.,!?:;()\'"„“«»_+-]{5,120}$/u';
|
$titlePattern = '/^[a-zA-Z0-9äöüÄÖÜß\s.,!?:;()\'"„“«»_+-]{5,120}$/u';
|
||||||
if (preg_match($titlePattern, $title)) {
|
if (preg_match($titlePattern, $title)) {
|
||||||
return true;
|
return true;
|
||||||
@@ -36,8 +38,9 @@ function articleTitleValidator($title)
|
|||||||
*/
|
*/
|
||||||
function articleContentValidator($content)
|
function articleContentValidator($content)
|
||||||
{
|
{
|
||||||
|
$content = trim($content);
|
||||||
$zeichenAnzahl = mb_strlen($content);
|
$zeichenAnzahl = mb_strlen($content);
|
||||||
if ($zeichenAnzahl <= 7000 && $zeichenAnzahl > 10) {
|
if ($zeichenAnzahl <= 7000 && $zeichenAnzahl >= 10) {
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user