X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/bf719ccede5264124859fd5a70242ce9bba830c1..67bff06aa6fd4d7d3a9aefc2919307326fa6d755:/api/channels.php diff --git a/api/channels.php b/api/channels.php index cebe6b9..f8e47ce 100644 --- a/api/channels.php +++ b/api/channels.php @@ -19,7 +19,7 @@ foreach($channels as $channel) $modes = (isset($channel->modes)) ? "+" . explode(" ",$channel->modes)[0] : ""; $topic = ''; if (isset($channel->topic)) - $topic = htmlentities($channel->topic, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 | ENT_DISALLOWED); + $topic = htmlentities(StripControlCharacters($channel->topic), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 | ENT_DISALLOWED); $date = explode("T", $channel->creation_time)[0]; $out[] = [ "Name" => htmlspecialchars($channel->name), @@ -32,7 +32,7 @@ foreach($channels as $channel) function custom_sort($a,$b) { - return ($b["Users"] > $a["Users"]) ? true : false; + return $b["Users"] <=> $a["Users"]; } usort($out, "custom_sort");