From fc96bee063c26ade2cdc89f255de580de9d43009 Mon Sep 17 00:00:00 2001 From: Marc Tobias Metten Date: Sun, 13 Mar 2016 03:01:19 +0100 Subject: [PATCH] second argument of array_merge can be empty --- lib/Geocode.php | 7 +++++-- website/reverse.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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 { -- 2.39.5