From b6459b3a38f001d53206e6b9c36365a856406f82 Mon Sep 17 00:00:00 2001 From: Ruan Date: Fri, 3 Jul 2015 16:47:07 +0200 Subject: [PATCH] Add banner display name support --- includes/page.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/page.php b/includes/page.php index 195e316..114e813 100644 --- a/includes/page.php +++ b/includes/page.php @@ -26,10 +26,7 @@ function get_avatar($name) { } function get_banner_name($banner) { - if ($banner === "CONSOLE") { - return "Console"; - } - return $banner; + return clean($banner); } function millis_to_date($millis) { @@ -38,8 +35,10 @@ function millis_to_date($millis) { } /** - * Prepares text to be displayed as a ban reason. + * Prepares text to be displayed on the web interface. + * Removes chat colours, replaces newlines with proper HTML, and sanitizes the text. * @param $text + * @return mixed|string */ function clean($text) { if (strstr($text, "\xa7") || strstr($text, "&")) {