diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index a3d26a7367..3617470df4 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1283,9 +1283,9 @@ class BBCode extends BaseObject function ($matches) use (&$codeblocks) { $return = '#codeblock-' . count($codeblocks) . '#'; if (strpos($matches[2], "\n") !== false) { - $codeblocks[] = '
' . trim($matches[2], "\n\r") . '
';
+ $codeblocks[] = '' . htmlspecialchars(trim($matches[2], "\n\r"), ENT_NOQUOTES, 'UTF-8') . '
';
} else {
- $codeblocks[] = '' . $matches[2] . '
';
+ $codeblocks[] = '' . htmlspecialchars($matches[2], ENT_NOQUOTES, 'UTF-8') . '
';
}
return $return;