]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix json output of empty arrays
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 15 Aug 2015 07:52:48 +0000 (09:52 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 15 Aug 2015 07:57:29 +0000 (09:57 +0200)
lib/Geocode.php
lib/PlaceLookup.php
lib/template/address-json.php
lib/template/address-jsonv2.php
lib/template/search-jsonv2.php

index a3ac4f0ecb0fe73060723aa1ec4e7719937d132f..afeaf68767614dae8165a1533c509bbb59dcd3ff 100644 (file)
                                        }
                                        else
                                        {
-                                               $aResult['sExtraTags'] = array();
+                                               $aResult['sExtraTags'] = (object) array();
                                        }
                                }
 
                                        }
                                        else
                                        {
-                                               $aResult['sNameDetails'] = array();
+                                               $aResult['sNameDetails'] = (object) array();
                                        }
                                }
 
index 23b9770701f0bcd58302a96035881aec0e01f774..c5129fee31006d47a011251a82a08237458703a3 100644 (file)
                                }
                                else
                                {
-                                       $aPlace['sExtraTags'] = array();
+                                       $aPlace['sExtraTags'] = (object) array();
                                }
                        }
 
                                }
                                else
                                {
-                                       $aPlace['sNameDetails'] = array();
+                                       $aPlace['sNameDetails'] = (object) array();
                                }
                        }
 
index c994eb02781181ae9d554e915049cd4118ab649c..ff245e145f4dac3414cd073592634c6cd933115e 100644 (file)
@@ -26,5 +26,5 @@
                if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
        }
 
-       javascript_renderData($aFilteredPlaces, JSON_FORCE_OBJECT);
+       javascript_renderData($aFilteredPlaces);
 
index f05dbd809d8d696f8ae07febbbcdf8efd0a03f8b..a8a05dd48cfa3c5a7e34c81372630245e93864bb 100644 (file)
@@ -38,4 +38,4 @@
                if (isset($aPlace['sNameDetails'])) $aFilteredPlaces['namedetails'] = $aPlace['sNameDetails'];
        }
 
-       javascript_renderData($aFilteredPlaces, JSON_FORCE_OBJECT);
+       javascript_renderData($aFilteredPlaces);
index 8006e3c2e02c2b9be965b1c65f0a68947cde1d85..e974772023393a39818205bc22abe0201c2207c3 100644 (file)
@@ -79,4 +79,4 @@
                $aFilteredPlaces[] = $aPlace;
        }
 
-       javascript_renderData($aFilteredPlaces, array('geojson'));
+       javascript_renderData($aFilteredPlaces);