]> git.openstreetmap.org Git - nominatim.git/commitdiff
don't have an address property in the return if we have not got address data
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Thu, 3 May 2012 23:59:26 +0000 (00:59 +0100)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Thu, 3 May 2012 23:59:26 +0000 (00:59 +0100)
lib/template/address-jsonv2.php
lib/template/search-jsonv2.php

index d697730c14226dd68378517376443bd2bcc272b7..51d3e1a3027863c51815fccd8dd465855f6cd2fd 100644 (file)
@@ -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']))
index 5e52238b73f029abc56a7e5e2f45994bfdc83919..cb09baa48dcbf7e6f634f0225cd4cce9df40c998 100644 (file)
@@ -47,7 +47,7 @@
                        $aPlace['icon'] = $aPointDetails['icon'];
                }
 
-               if (isset($aPointDetails['address']))
+               if (isset($aPointDetails['address']) && sizeof($aPointDetails['address'])>0)
                {
                        $aPlace['address'] = $aPointDetails['address'];
                 }