diff --git a/application/ConstructionConsentProject/ConstructionConsentProject.php b/application/ConstructionConsentProject/ConstructionConsentProject.php index 1d7c2965b..c0844a85a 100644 --- a/application/ConstructionConsentProject/ConstructionConsentProject.php +++ b/application/ConstructionConsentProject/ConstructionConsentProject.php @@ -274,6 +274,9 @@ AND ( (cco.zip IS NULL OR cco.zip NOT REGEXP '^[0-9]{4}$') ) OR + /* street lowercase should not be oesterreich, österreich, austria, germany, deutschland, schweiz, switzerland */ + (LOWER(cco.street) NOT REGEXP '^(österreich|austria|germany|deutschland|schweiz|switzerland)$') + OR /* For Germany: ZIP must be exactly 5 digits */ ( (LOWER(cco.country) = 'deutschland' OR LOWER(cco.country) = 'germany') AND @@ -361,6 +364,9 @@ AND ( (cco.zip IS NULL OR cco.zip NOT REGEXP '^[0-9]{4}$') ) OR + /* street lowercase should not be oesterreich, österreich, austria, germany, deutschland, schweiz, switzerland */ + (LOWER(cco.street) NOT REGEXP '^(österreich|austria|germany|deutschland|schweiz|switzerland)$') + OR /* For Germany: ZIP must be exactly 5 digits */ ( (LOWER(cco.country) = 'deutschland' OR LOWER(cco.country) = 'germany') AND @@ -406,6 +412,12 @@ ORDER BY $errors[] = 'country'; } + // Check street for specific lowercase values + $streetLower = strtolower(trim($data['street'] ?? '')); + if (in_array($streetLower, ['österreich', 'austria', 'germany', 'deutschland', 'schweiz', 'switzerland'])) { + $errors[] = 'street'; + } + // Check ZIP based on country $country = strtolower($data['country'] ?? ''); diff --git a/public/js/pages/ConstructionConsentFaultyEntries/ConstructionConsentFaultyEntries.js b/public/js/pages/ConstructionConsentFaultyEntries/ConstructionConsentFaultyEntries.js index 6dff2b780..a4e947f22 100644 --- a/public/js/pages/ConstructionConsentFaultyEntries/ConstructionConsentFaultyEntries.js +++ b/public/js/pages/ConstructionConsentFaultyEntries/ConstructionConsentFaultyEntries.js @@ -166,6 +166,7 @@ Vue.component('construction-consent-faulty-entries', { 'lastname': 'Fehlender Nachname', 'city': 'Fehlende Stadt', 'zip': 'Ungültige PLZ', + 'street': 'Ungültige Straße', 'country': 'Ungültiges Land (enthält Zahlen)' }; return errors[error] || error;