From 23f1fb89f222bb6ff8c963c21b253ea48ebb5103 Mon Sep 17 00:00:00 2001 From: Roardom Date: Mon, 20 Jan 2025 10:31:28 +0000 Subject: [PATCH] fix: html inside wikis and pages being escaped Staff are trusted and should be allowed to add custom html/styles/scripts to site pages and wikis, as they were before. Regression from #3222. --- app/Models/Page.php | 2 +- app/Models/Wiki.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Page.php b/app/Models/Page.php index 0a366f9646..04e316f3e2 100644 --- a/app/Models/Page.php +++ b/app/Models/Page.php @@ -58,6 +58,6 @@ public function setContentAttribute(?string $value): void */ public function getContentHtml(): string { - return Markdown::convert((new Bbcode())->parse($this->content, false))->getContent(); + return Markdown::convert(htmlspecialchars_decode((new Bbcode())->parse($this->content, false)))->getContent(); } } diff --git a/app/Models/Wiki.php b/app/Models/Wiki.php index 464f56259f..6fcb0424ab 100644 --- a/app/Models/Wiki.php +++ b/app/Models/Wiki.php @@ -52,6 +52,6 @@ public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function getContentHtml(): string { - return Markdown::convert((new Bbcode())->parse($this->content, false))->getContent(); + return Markdown::convert(htmlspecialchars_decode((new Bbcode())->parse($this->content, false)))->getContent(); } }