X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5581bb67f87b3f509f396454a2a86d10f97a64a7..86ca377b1a1505c7a599746c095bc83156e3997d:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index c68f04eb..57bd4723 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']))