Redo nl2br

This commit is contained in:
Kilian Hofmann 2024-07-27 16:14:39 +02:00
parent 43e2c6c0ad
commit 74fd55084f

View File

@ -70,7 +70,7 @@ class Post implements JsonSerializable
VALUES(:USR, :CON)"
);
$stmt->bindValue(":USR", $user->getID());
$stmt->bindValue(":CON", htmlspecialchars($content));
$stmt->bindValue(":CON", nl2br(htmlspecialchars($content)));
$stmt->execute();
@ -126,7 +126,7 @@ class Post implements JsonSerializable
$content = substr(trim($content), 0, 250);
$stmt = $db->prepare("UPDATE egb_gaestebuch SET beitrag = :CON WHERE id = :ID");
$stmt->bindValue(":CON", htmlspecialchars($content));
$stmt->bindValue(":CON", nl2br(htmlspecialchars($content)));
$stmt->bindValue(":ID", $this->id);
try {
if (!$stmt->execute()) {