dev auf main #68

Open
niklas.ortmann wants to merge 1044 commits from devNachCSRF into main
Showing only changes of commit 50b29c96d6 - Show all commits
+10 -1
View File
@@ -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",
@@ -89,4 +98,4 @@ header(
. urlencode((string) $articleId)
. "#comments"
);
exit();
exit();