Skip to content

Commit 4b212d0

Browse files
authored
Merge pull request #4442 from Roardom/fix-markdown-escape
(Fix) HTML inside wikis and pages being escaped
2 parents 6293168 + 23f1fb8 commit 4b212d0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: app/Models/Page.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public function setContentAttribute(?string $value): void
5858
*/
5959
public function getContentHtml(): string
6060
{
61-
return Markdown::convert((new Bbcode())->parse($this->content, false))->getContent();
61+
return Markdown::convert(htmlspecialchars_decode((new Bbcode())->parse($this->content, false)))->getContent();
6262
}
6363
}

Diff for: app/Models/Wiki.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
5252
*/
5353
public function getContentHtml(): string
5454
{
55-
return Markdown::convert((new Bbcode())->parse($this->content, false))->getContent();
55+
return Markdown::convert(htmlspecialchars_decode((new Bbcode())->parse($this->content, false)))->getContent();
5656
}
5757
}

0 commit comments

Comments
 (0)