]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/template/address-jsonv2.php
properly quote quotes in type field
[nominatim.git] / lib / template / address-jsonv2.php
index 9624718273fadcc64679bf4a456150f1d75c9b7a..baf53129e13aec93d6e470c838d27e343c4061ca 100644 (file)
@@ -3,7 +3,7 @@
 
        if (!sizeof($aPlace))
        {
-               if ($sError)
+               if (isset($sError))
                        $aFilteredPlaces['error'] = $sError;
                else
                        $aFilteredPlaces['error'] = 'Unable to geocode';
@@ -11,7 +11,7 @@
        else
        {
                if ($aPlace['place_id']) $aFilteredPlaces['place_id'] = $aPlace['place_id'];
-               $aFilteredPlaces['licence'] = "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC-BY-SA 2.0.";
+               $aFilteredPlaces['licence'] = "Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright";
                $sOSMType = ($aPlace['osm_type'] == 'N'?'node':($aPlace['osm_type'] == 'W'?'way':($aPlace['osm_type'] == 'R'?'relation':'')));
                 if ($sOSMType)
                 {
@@ -26,7 +26,7 @@
 
                $aFilteredPlaces['display_name'] = $aPlace['langaddress'];
                 $aFilteredPlaces['name'] = $aPlace['placename'];
-               if ($bShowAddressDetails && $aAddress && sizeof($aAddress)) $aFilteredPlaces['address'] = $aAddress;
+               if ($bShowAddressDetails && $aPlace['aAddress'] && sizeof($aPlace['aAddress'])) $aFilteredPlaces['address'] = $aPlace['aAddress'];
        }
 
        javascript_renderData($aFilteredPlaces);