From 06fa443b3ee6b38c23b59b0e0fe5d93d615f9eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Wed, 17 Dec 2025 21:22:17 +0100 Subject: [PATCH] trimming additional spaces example TEST 2 now to TEST 2 --- app/Services/ImportProcessor.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Services/ImportProcessor.php b/app/Services/ImportProcessor.php index 11be0cb..92854f0 100644 --- a/app/Services/ImportProcessor.php +++ b/app/Services/ImportProcessor.php @@ -3110,8 +3110,10 @@ private function upsertEmail(int $personId, array $emailData, $mappings): array private function upsertAddress(int $personId, array $addrData, $mappings): array { $addressLine = trim((string) ($addrData['address'] ?? '')); - // Normalize whitespace + // Normalize whitespace: collapse multiples and tighten around separators $addressLine = preg_replace('/\s+/', ' ', $addressLine); + $addressLine = preg_replace('/\s*([,;\/])\s*/', '$1 ', $addressLine); + $addressLine = trim($addressLine); // Skip common placeholders or missing values if ($addressLine === '' || $addressLine === '0' || strcasecmp($addressLine, '#N/A') === 0 || preg_match('/^(#?n\/?a|na|null|none)$/i', $addressLine)) { return ['action' => 'skipped', 'message' => 'No address value']; @@ -3372,6 +3374,3 @@ protected function attemptContractReactivation(Contract $contract, ?Authenticata } } } - - -