Update createArticle-controller.php

This commit is contained in:
2026-06-02 00:14:25 +02:00
parent 4f827ed3a8
commit c9c0de6c3c
+5 -5
View File
@@ -8,11 +8,6 @@ require_once "../model/LocalUserDAO.php";
try{ try{
$dao = new LocalUserDAO(); $dao = new LocalUserDAO();
$user = $dao->findUser($_SESSION["user_email"] ?? ""); $user = $dao->findUser($_SESSION["user_email"] ?? "");
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
header("location: ../../index.php?pfad=createArticle");
exit();
}
if ($_SERVER["REQUEST_METHOD"] === "POST") { if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["old_title"] = $_POST["title"] ?? ''; $_SESSION["old_title"] = $_POST["title"] ?? '';
$_SESSION["old_content"] = $_POST["content"] ?? ''; $_SESSION["old_content"] = $_POST["content"] ?? '';
@@ -91,6 +86,11 @@ try{
exit(); exit();
} }
} }
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
header("location: ../../index.php?pfad=createArticle");
exit();
}
?> ?>