From 5de42d94fcda30bfb59f2065c4bc815e1a46c6d9 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 18 May 2025 21:02:05 -0700 Subject: [PATCH] fix: Fixes detecting consecutive exceptions in name validation (#2192) --- Projects/UOContent/Misc/NameVerification.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Projects/UOContent/Misc/NameVerification.cs b/Projects/UOContent/Misc/NameVerification.cs index ae934b261..d35c2b883 100644 --- a/Projects/UOContent/Misc/NameVerification.cs +++ b/Projects/UOContent/Misc/NameVerification.cs @@ -216,6 +216,7 @@ public static class NameVerification } var index = name.IndexOfAny(exceptions); + var exceptionCount = 0; while (index != -1) { @@ -229,7 +230,7 @@ public static class NameVerification noExceptionsAtStart = false; } - if (maxExceptions-- <= 0) + if (exceptionCount++ >= maxExceptions) { return true; } @@ -238,6 +239,10 @@ public static class NameVerification { name = name[(index + 1)..]; index = name.IndexOfAny(exceptions); + if (index != 0) + { + exceptionCount = 0; + } } else {