From 4d0693ea69f15660c7fd931c4bce7b648b97ff0f Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Fri, 4 May 2012 00:59:26 +0100 Subject: [PATCH] don't have an address property in the return if we have not got address data --- lib/template/address-jsonv2.php | 2 +- lib/template/search-jsonv2.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/template/address-jsonv2.php b/lib/template/address-jsonv2.php index d697730c..51d3e1a3 100644 --- a/lib/template/address-jsonv2.php +++ b/lib/template/address-jsonv2.php @@ -29,7 +29,7 @@ $aFilteredPlaces['display_name'] = $aPlace['langaddress']; $aFilteredPlaces['name'] = $aPlace['placename']; - if ($bShowAddressDetails) $aFilteredPlaces['address'] = $aAddress; + if ($bShowAddressDetails && $aAddress && sizeof($aAddress)) $aFilteredPlaces['address'] = $aAddress; } if (isset($_GET['json_callback']) && preg_match('/^[-A-Za-z0-9:_]+$/',$_GET['json_callback'])) diff --git a/lib/template/search-jsonv2.php b/lib/template/search-jsonv2.php index 5e52238b..cb09baa4 100644 --- a/lib/template/search-jsonv2.php +++ b/lib/template/search-jsonv2.php @@ -47,7 +47,7 @@ $aPlace['icon'] = $aPointDetails['icon']; } - if (isset($aPointDetails['address'])) + if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0) { $aPlace['address'] = $aPointDetails['address']; } -- 2.39.5