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: v3.0.0~200^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/22ebd1c7a970502ea94d1d6266e5167e5ec33083?hp=-c second argument of array_merge can be empty --- 22ebd1c7a970502ea94d1d6266e5167e5ec33083 diff --git a/lib/Geocode.php b/lib/Geocode.php index 1dbde919..19ed354f 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1647,8 +1647,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 d1c554a4..3254e710 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -102,9 +102,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 {