Merge branch 'bugs' into devNachCSRF

This commit is contained in:
2026-07-20 00:05:39 +02:00
3 changed files with 10 additions and 4 deletions
-1
View File
@@ -1,5 +1,4 @@
<?php
include_once 'php/controller/profile-controller.php';
$user = $user ?? null;
$isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
+2
View File
@@ -20,6 +20,8 @@ if ($pfad === "login") {
include_once "php/controller/confirm-register-controller.php";
} elseif ($pfad === "confirm-password") {
include_once "php/controller/confirm-password-controller.php";
} elseif ($pfad === "profile") {
include_once "php/controller/profile-controller.php";
} elseif ($pfad === "updateComment") {
include_once "php/controller/updateComment-controller.php";
} elseif($pfad === "deleteComment") {
+8 -3
View File
@@ -63,9 +63,12 @@ class DatabaseArticleManager implements ArticleManagerDAO {
VALUES (:title, :content, :author, :category, :tags);";
$command = $db->prepare($sql);
if (!$command) {
throw new InternalServerErrorException("internal_error");
}
// Verknüpft die übergebenen Parameter exakt mit den SQL-Platzhaltern
$command->execute([
$success = $command->execute([
":title" => $title,
":content" => $content,
":author" => $author,
@@ -73,10 +76,13 @@ class DatabaseArticleManager implements ArticleManagerDAO {
":tags" => $tags
]);
if (!$success) {
throw new InternalServerErrorException("internal_error");
}
return intval($db->lastInsertId());
} catch (PDOException $e) {
throw new InternalServerErrorException("internal_error");
}
}
@@ -321,7 +327,6 @@ class DatabaseArticleManager implements ArticleManagerDAO {
}
}
/**
* Holt alle User-IDs, die einen bestimmten Beitrag geliked haben.
*