X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1d9b1fcd99e05f2222306d53256faff024c4ed96..dc769b0c6b160015c25d433968ea589fd7ddd0e1:/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']))