From e0d29f398ef4160ffdf47c1a42a0af9fcf632bf4 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 27 May 2020 11:16:27 +0200 Subject: [PATCH] each address line must fill at most one geocodejson field This fixes an issue where a postcode with rank_address 5 would also appear in the state field. --- lib/AddressDetails.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/AddressDetails.php b/lib/AddressDetails.php index dd867079..a27d3e79 100644 --- a/lib/AddressDetails.php +++ b/lib/AddressDetails.php @@ -117,8 +117,12 @@ class AddressDetails if ($aLine['type'] == 'postcode' || $aLine['type'] == 'postal_code') { $aJson['postcode'] = $aLine['localname']; - } elseif ($aLine['type'] == 'house_number') { + continue; + } + + if ($aLine['type'] == 'house_number') { $aJson['housenumber'] = $aLine['localname']; + continue; } if ($this->iPlaceID == $aLine['place_id']) {