X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b11461907f02b4f583e22ccdf90550f00f1f39b7..fa0cf215e723401fec62a3b336a4ed8908c2bfed:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index e548dc3a..dfd7008d 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -39,6 +39,12 @@ exit; } + function getParamBool($name, $default=false) + { + if (!isset($_GET[$name])) return $default; + + return (bool) $_GET[$name]; + } function fail($sError, $sUserError = false) { @@ -668,12 +674,11 @@ } - 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']))