diff --git a/includes/page.php b/includes/page.php index c69fde0..f0086ad 100644 --- a/includes/page.php +++ b/includes/page.php @@ -42,9 +42,13 @@ function millis_to_date($millis) { * @param $text */ function clean($text) { + $text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8'); if (strstr($text, "\xa7") || strstr($text, "&")) { $regex = "/(?i)(\xa7|&)[0-9A-FK-OR]/"; - return preg_replace($regex, "", $text); + $text = preg_replace($regex, "", $text); + } + if (strstr($text, "\n")) { + $text = preg_replace("/\n/", "
", $text); } return $text; }