From 6aa1cd9a6304b6f0aea1c33ebedc1904744c008b Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 1 Jun 2026 11:30:07 +0200 Subject: [PATCH] Update createArticle-controller.php --- php/controller/createArticle-controller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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();