]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - api/channels.php
Fix setting zlines on idents, reported by Jellis
[irc/unrealircd/unrealircd-webpanel.git] / api / channels.php
index cebe6b959360e780158cdc62c7f798e79ea4e14a..f8e47cec7b760964f309c23b58b3ec090264801b 100644 (file)
@@ -19,7 +19,7 @@ foreach($channels as $channel)
        $modes = (isset($channel->modes)) ? "+" . explode(" ",$channel->modes)[0] : "<none>";
        $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");