diff --git a/php/controller/createArticle-controller.php b/php/controller/createArticle-controller.php index 9533580..a4c0fa2 100644 --- a/php/controller/createArticle-controller.php +++ b/php/controller/createArticle-controller.php @@ -60,11 +60,12 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { header("location: ../../index.php?pfad=createArticle"); exit(); } + $validatedCategory = $category; echo "Kategorievalidierung erfolgreich"; // -------------------------- Eingabevalidierung der tags: ---------------------- if (isset($_POST['tags'])) { - $tags = trim($_POST['tags']); + $tags = $_POST['tags']; } else { $tags = ''; } @@ -96,8 +97,10 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { echo "Tagvalidierung erfolgreich"; // ----------------- Übertragung der validierten Daten in ArticleManager: --------------------------- - if (!isset($validatedTitle) || !isset($validatedContent) || !isset($validatedCategory) || !isset($validatedTags)) { + if (!isset($validatedTitle) || !isset($validatedContent) || !isset($validatedAuthor) || !isset($validatedCategory) || !isset($validatedTags)) { $_SESSION["message"] = "validation_missing"; + header("location: ../../index.php?pfad=createArticle"); + exit(); } else { try { $articleManager = ArticleManager::getInstance();