From c7853633846a9faa0ef4ef08413c07e49585f61d Mon Sep 17 00:00:00 2001 From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com> Date: Fri, 29 May 2026 17:40:56 +0100 Subject: [PATCH] missing_id --- content/updateArticle.php | 2 +- php/controller/showArticle-controller.php | 1 + php/controller/updateArticle-controller.php | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/content/updateArticle.php b/content/updateArticle.php index 4595eb3..3266217 100644 --- a/content/updateArticle.php +++ b/content/updateArticle.php @@ -8,7 +8,7 @@ include_once 'php/controller/showArticle-controller.php';
- +

Es ist ein Fehler beim Speichern aufgetreten. Bitte versuche es erneut.

diff --git a/php/controller/showArticle-controller.php b/php/controller/showArticle-controller.php index ea27a0c..c7c6357 100644 --- a/php/controller/showArticle-controller.php +++ b/php/controller/showArticle-controller.php @@ -5,6 +5,7 @@ require_once 'php/model/ArticleManager.php'; if (isset($_GET["id"])){ try { + $id = (int)$_GET["id"]; $articleManager = ArticleManager::getInstance(); $article = $articleManager->getArticle($_GET["id"]); if($article != null){ diff --git a/php/controller/updateArticle-controller.php b/php/controller/updateArticle-controller.php index b506d27..6df27d1 100644 --- a/php/controller/updateArticle-controller.php +++ b/php/controller/updateArticle-controller.php @@ -9,7 +9,9 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { $_SESSION["message"] = "missing_parameters"; header("location: ../../index.php?pfad=updateArticle"); exit(); - } else { + } elseif(!isset($id)) { + $_SESSION["message"] = "missing_id"; + }else{ $newTitle = $_POST["title"]; $newContent = $_POST["content"];