X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/890d415e1ffd997d11ed35dee04cb01b94ca133f..9cfd891fb981a2a4241e24c4f3c4b5519eceda48:/lib/AddressDetails.php diff --git a/lib/AddressDetails.php b/lib/AddressDetails.php index f5293586..783a0fda 100644 --- a/lib/AddressDetails.php +++ b/lib/AddressDetails.php @@ -14,10 +14,10 @@ class AddressDetails public function __construct(&$oDB, $iPlaceID, $sHousenumber, $mLangPref) { if (is_array($mLangPref)) { - $mLangPref = 'ARRAY['.join(',', array_map('getDBQuoted', $mLangPref)).']'; + $mLangPref = $oDB->getArraySQL($oDB->getDBQuotedList($mLangPref)); } - if (!$sHousenumber) { + if (!isset($sHousenumber)) { $sHousenumber = -1; } @@ -31,7 +31,7 @@ class AddressDetails private static function isAddress($aLine) { - return $aLine['isaddress'] == 't' || $aLine['type'] == 'country_code'; + return $aLine['isaddress'] || $aLine['type'] == 'country_code'; } public function getAddressDetails($bAll = false) @@ -49,7 +49,7 @@ class AddressDetails $sPrevResult = ''; foreach ($this->aAddressLines as $aLine) { - if ($aLine['isaddress'] == 't' && $sPrevResult != $aLine['localname']) { + if ($aLine['isaddress'] && $sPrevResult != $aLine['localname']) { $sPrevResult = $aLine['localname']; $aParts[] = $sPrevResult; }