From: Marc Tobias Metten Date: Sun, 13 Mar 2016 02:01:19 +0000 (+0100) Subject: second argument of array_merge can be empty X-Git-Tag: deploy~430 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/fc96bee063c26ade2cdc89f255de580de9d43009?ds=sidebyside second argument of array_merge can be empty --- diff --git a/lib/Geocode.php b/lib/Geocode.php index 48055ec6..5efb2422 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1652,8 +1652,11 @@ $oPlaceLookup->setPolygonSimplificationThreshold($this->fPolygonSimplificationThreshold); $aOutlineResult = $oPlaceLookup->getOutlines($aResult['place_id'], $aResult['lon'], $aResult['lat'], $fDiameter/2); - $aResult = array_merge($aResult, $aOutlineResult); - + if ($aOutlineResult) + { + $aResult = array_merge($aResult, $aOutlineResult); + } + if ($aResult['extra_place'] == 'city') { $aResult['class'] = 'place'; diff --git a/website/reverse.php b/website/reverse.php index 1f6e0aad..b1a7d77e 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -89,9 +89,12 @@ $oPlaceLookup->setPolygonSimplificationThreshold($fThreshold); $fRadius = $fDiameter = getResultDiameter($aPlace); - $aOutlineResult = $oPlaceLookup->getOutlines($aPlace['place_id'],$aPlace['lon'],$aPlace['lat'],$fRadius); + $aOutlineResult = $oPlaceLookup->getOutlines($aPlace['place_id'], $aPlace['lon'], $aPlace['lat'], $fRadius); - $aPlace = array_merge($aPlace, $aOutlineResult); + if ($aOutlineResult) + { + $aPlace = array_merge($aPlace, $aOutlineResult); + } } else {