X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a7edda32ba995cf1c0ceebf1778bb7c483e962da..631013be0208bf1bac14069f946b647049352b37:/lib/AddressDetails.php?ds=sidebyside diff --git a/lib/AddressDetails.php b/lib/AddressDetails.php index 783a0fda..61823b4c 100644 --- a/lib/AddressDetails.php +++ b/lib/AddressDetails.php @@ -76,14 +76,14 @@ class AddressDetails $bFallback = true; } - $sName = false; - if (isset($aLine['localname']) && $aLine['localname']) { + $sName = null; + if (isset($aLine['localname']) && $aLine['localname']!=='') { $sName = $aLine['localname']; - } elseif (isset($aLine['housenumber']) && $aLine['housenumber']) { + } elseif (isset($aLine['housenumber']) && $aLine['housenumber']!=='') { $sName = $aLine['housenumber']; } - if ($sName) { + if (isset($sName)) { $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel']) ? $aTypeLabel['simplelabel'] : $aTypeLabel['label']); $sTypeLabel = str_replace(' ', '_', $sTypeLabel); if (!isset($aAddress[$sTypeLabel]) @@ -97,6 +97,7 @@ class AddressDetails } } } + return $aAddress; }