X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6a7e0d652b1d40a397e1c1386d500101796676c4..9934421442bf1a815096ef06ffa3f8c9ea11c0ac:/lib-php/AddressDetails.php diff --git a/lib-php/AddressDetails.php b/lib-php/AddressDetails.php index 3d17ede5..91e3d89f 100644 --- a/lib-php/AddressDetails.php +++ b/lib-php/AddressDetails.php @@ -61,7 +61,7 @@ class AddressDetails return join(', ', $aParts); } - public function getAddressNames($sCountry = null) + public function getAddressNames() { $aAddress = array(); @@ -79,13 +79,11 @@ class AddressDetails $sName = $aLine['housenumber']; } - if (isset($sName)) { - $sTypeLabel = strtolower(str_replace(' ', '_', $sTypeLabel)); - if (!isset($aAddress[$sTypeLabel]) - || $aLine['class'] == 'place' - ) { - $aAddress[$sTypeLabel] = $sName; - } + if (isset($sName) + && (!isset($aAddress[$sTypeLabel]) + || $aLine['class'] == 'place') + ) { + $aAddress[$sTypeLabel] = $sName; } }