Update updateComment-controller.php

This commit is contained in:
2026-07-19 16:01:06 +02:00
parent d5fc5f3065
commit 50b29c96d6
@@ -5,6 +5,7 @@ if (session_status() === PHP_SESSION_NONE) {
}
require_once "php/model/CommentManager.php";
require_once "includes/csrf.php";
if ($_SERVER["REQUEST_METHOD"] !== "POST") {
header("Location: index.php");
@@ -16,6 +17,14 @@ if (!isset($_SESSION["user_email"])) {
exit();
}
// CSRF-Token prüfen, bevor irgendeine Änderung vorgenommen wird
if (!csrf_verify()) {
$_SESSION["comment_message"] = "Deine Sitzung ist abgelaufen. Bitte lade die Seite neu.";
$_SESSION["comment_message_type"] = "error";
header("Location: index.php");
exit();
}
$commentId = filter_input(
INPUT_POST,
"comment_id",