fix: Fixes detecting consecutive exceptions in name validation (#2192)
This commit is contained in:
parent
f630ec2a2d
commit
5de42d94fc
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue