diff --git a/inc/page.php b/inc/page.php index 1bd5728..6fca245 100644 --- a/inc/page.php +++ b/inc/page.php @@ -319,9 +319,12 @@ class Page { */ function clean($text) { if ($text === null) return null; - if (strstr($text, "\xa7") || strstr($text, "&")) { + if (strstr($text, "\xa7") || strstr($text, "&")) { // Regular chat colours $text = preg_replace("/(?i)(\x{00a7}|&)[0-9A-FK-OR]/u", "", $text); } + if (strstr($text, "#")) { // Hex colours + $text = preg_replace("/(?i)#[0-9A-F]{6}/u", "", $text); + } $text = htmlspecialchars($text, ENT_QUOTES); if (strstr($text, "\\n")) { $text = preg_replace("/\\\\n/", "
", $text);