Remove nl2br

This commit is contained in:
Kilian Hofmann 2024-07-27 16:12:03 +02:00
parent 64311f2765
commit 43e2c6c0ad
2 changed files with 5 additions and 3 deletions

View File

@ -70,7 +70,7 @@ class Post implements JsonSerializable
VALUES(:USR, :CON)"
);
$stmt->bindValue(":USR", $user->getID());
$stmt->bindValue(":CON", $content);
$stmt->bindValue(":CON", 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", nl2br(htmlspecialchars($content)));
$stmt->bindValue(":CON", htmlspecialchars($content));
$stmt->bindValue(":ID", $this->id);
try {
if (!$stmt->execute()) {

View File

@ -245,7 +245,9 @@ class User implements JsonSerializable
b.id, b.benutzer, b.status, b.email, b.image, b.isadmin, b.zeitstempel,
(SELECT COUNT(*) FROM egb_gaestebuch WHERE benutzer_id = b.id) as postCount
FROM
egb_benutzer AS b"
egb_benutzer AS b
LIMIT $limit
OFFSET " . ($page * $limit)
);
$stmt->execute();
$data = $stmt->fetchAll();