]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Banning system: prevent a bug where any redundant space in a ban list bans all player...
authorterencehill <piuntn@gmail.com>
Fri, 9 Jun 2023 14:53:59 +0000 (16:53 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 9 Jun 2023 14:53:59 +0000 (16:53 +0200)
qcsrc/server/client.qc

index b6d6e25e8dd9e3347387eaaacbada358d69d5feb..0a8846d5d166ee6750dc83fd4e0da570c8d4c0ab 100644 (file)
@@ -982,7 +982,7 @@ bool findinlist_abbrev(string tofind, string list)
                return false; // empty list or search, just return
 
        // this function allows abbreviated strings!
-       FOREACH_WORD(list, it == substring(tofind, 0, strlen(it)),
+       FOREACH_WORD(list, it != "" && it == substring(tofind, 0, strlen(it)),
        {
                return true;
        });
@@ -1010,6 +1010,8 @@ bool PlayerInIDList(entity p, string idlist)
 
 bool PlayerInList(entity player, string list)
 {
+       if (list == "")
+               return false;
        return boolean(PlayerInIDList(player, list) || PlayerInIPList(player, list));
 }