]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/lib.php
add extratags and name details to PlaceLookup (reverse)
[nominatim.git] / lib / lib.php
index c68f04eb9df20e05c13c0a9819cdb4a743148b75..57bd4723cdc2a284875770f9f39f8f0e449e4324 100644 (file)
                exit;
        }
 
+       function getParamBool($name, $default=false)
+       {
+               if (!isset($_GET[$name])) return $default;
+
+               return (bool) $_GET[$name];
+       }
 
        function fail($sError, $sUserError = false)
        {
        }
 
 
-       function javascript_renderData($xVal)
+       function javascript_renderData($xVal, $iOptions = 0)
        {
                header("Access-Control-Allow-Origin: *");
-               $iOptions = 0;
                if (defined('PHP_VERSION_ID') && PHP_VERSION_ID > 50400)
-                       $iOptions = JSON_UNESCAPED_UNICODE;
+                       $iOptions |= JSON_UNESCAPED_UNICODE;
                $jsonout = json_encode($xVal, $iOptions);
 
                if( ! isset($_GET['json_callback']))