X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db3ced17bbfff00411f506d8c84419c875959d5e..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; } }