From: terencehill Date: Fri, 9 Jun 2023 14:53:59 +0000 (+0200) Subject: Banning system: prevent a bug where any redundant space in a ban list bans all player... X-Git-Tag: xonotic-v0.8.6~21^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=812f0af1726adf185011ae236efab77759540624;p=xonotic%2Fxonotic-data.pk3dir.git Banning system: prevent a bug where any redundant space in a ban list bans all players; also optimize PlayerInList --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index b6d6e25e8..0a8846d5d 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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)); }