skwasjer / IbanNet

C# .NET IBAN validator, parser, builder and generator
Apache License 2.0
119 stars 31 forks source link

Bug in NoIllegalCharactersRule #25

Closed PapunaMishvidze closed 3 years ago

PapunaMishvidze commented 3 years ago

Hi,

Thank you for the Library!

IbanNet.Extensions.IsAlphaNumeric is written the following way

    /// <summary>
    /// Returns true if char is 0-9, a-z or A-Z and false otherwise.
    /// </summary>
    public static bool IsAlphaNumeric(this char ch)
    {
        ch |= ' ';
        return IsInRange(ch, '0', '9') || IsInRange(ch, 'a', 'z');
    }

As you can see, It is missing the following condition (|| InRange(ch, 'A', 'Z');), which will lead to an unexpected behavior. I wonder how come that it has not been discovered yet.

Please, fix it.

Thank you.

PapunaMishvidze commented 3 years ago

This issue was false possitive. ch |= ' '; does the trick of converting Uppercase characters to lowercase ones.

My apologies.