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"];