Kommentarfunktion für Nutzer einschränken

This commit is contained in:
2026-06-15 23:22:00 +02:00
parent 901232b683
commit e20b59b43d
4 changed files with 40 additions and 103 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ require_once "../model/CommentManager.php";
if (!isset($_SESSION["user_email"])) {
echo json_encode([
"success" => false,
"message" => "Du musst angemeldet sein."
"message" => "Du musst angemeldet sein, um zu kommentieren."
]);
exit();
}
@@ -17,7 +17,7 @@ $articleId = $_POST["article_id"] ?? null;
$content = trim($_POST["content"] ?? "");
$parentCommentId = $_POST["parent_comment_id"] ?? null;
if ($parentCommentId === "") {
if ($parentCommentId === "" || $parentCommentId === "0") {
$parentCommentId = null;
}