[fix:] fixed issue where countires with shorter or longer plz's have been discriminated

This commit is contained in:
Elias Fierke
2025-07-09 23:33:40 +02:00
parent 66398406d3
commit 818122e449

View File

@@ -46,12 +46,16 @@ public class AddressCheck
var address_component_count = 2; // cause anrede and name are first var address_component_count = 2; // cause anrede and name are first
// Prüfung // Prüfung
if (person.plz < 10000) if ((person.plz < 10000 && string.IsNullOrWhiteSpace(person.land)) ||
(person.plz < 10000 && person.land == "GER") ||
(person.plz < 10000 && person.land == "DE"))
{ {
hasFaults = true; hasFaults = true;
errors.Add(ErrorTypes.PlzTooShort); errors.Add(ErrorTypes.PlzTooShort);
} }
else if (person.plz > 99999) else if ((person.plz > 99999 && string.IsNullOrWhiteSpace(person.land)) ||
(person.plz > 99999 && person.land == "GER") ||
(person.plz > 99999 && person.land == "DE"))
{ {
hasFaults = true; hasFaults = true;
errors.Add(ErrorTypes.PlzTooLong); errors.Add(ErrorTypes.PlzTooLong);