From: Sarah Hoffmann Date: Sun, 13 Mar 2016 20:38:57 +0000 (+0100) Subject: Merge pull request #395 from mtmail/php7-support X-Git-Tag: v3.0.0~199 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/50f17666fa0200c5b1131b784347867f61f0f8aa?hp=df764a3f3bcd55e6f7bae4db204848bee0da2a7a Merge pull request #395 from mtmail/php7-support fix for PHP7, added test setup --- 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 {