From 85d94c6f49aa83abbb31292c4a7c5c5246d51198 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 2 Mar 2021 19:55:54 +0000 Subject: Fix fuzzy matching in core_who. Previously this code would consider requests with fields but no flags as fuzzy. This is incorrect as users can make requests like: WHO Sadie %n Reported by @ilbelkyr. --- src/coremods/core_who.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index fdf8919a2..135504b84 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -77,9 +77,6 @@ struct WhoData : public Who::Request if (matchtext == "0") matchtext = "*"; - // Fuzzy matches are when the source has not specified a specific user. - fuzzy_match = (parameters.size() > 1) || (matchtext.find_first_of("*?.") != std::string::npos); - // If flags have been specified by the source. if (parameters.size() > 1) { @@ -108,6 +105,9 @@ struct WhoData : public Who::Request current_bitset->set(chr); } } + + // Fuzzy matches are when the source has not specified a specific user. + fuzzy_match = flags.any() || (matchtext.find_first_of("*?.") != std::string::npos); } }; -- cgit v1.2.3