diff --git a/includes/utilities.php b/includes/utilities.php index 78206ac..eeb1ffc 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -138,19 +138,17 @@ function getAcfStateNameFromEnglish($localisation) function getGenericStateNameFromAcfStateName($state) { - if ($state === 'Bruxelles') { - return 'brussels'; - } - - if ($state === 'Vlaams Gewest') { - return 'flanders'; - } - - if ($state === 'Région Wallonne') { - return 'wallonia'; - } - if ($state === 'all') { - return 'all'; + switch ($state) { + case 'Bruxelles': + return 'brussels'; + case 'Région flamande': + case 'Vlaams Gewest': + return 'flanders'; + case 'Région Wallonne': + return 'wallonia'; + case 'all': + default: + return 'all'; } }; @@ -246,7 +244,7 @@ function getRelativeTimeFromTimestamp($timestamp) function format_phone_number($phoneNumber) { // Nettoyage du numéro : retirer espaces, tirets, points, etc. - + if (!$phoneNumber) return; $cleanedNumber = preg_replace('/\D+/', '', $phoneNumber); $phoneType = detectBelgianPhoneType($cleanedNumber);