X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ddb2e4aa1271a9b991f08bcbfad21676e5f5f393..ef1a7d9073640632a1470dcff29688bf53268360:/lib/lib.php diff --git a/lib/lib.php b/lib/lib.php index c68f04eb..50cf3dc4 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'])) @@ -965,7 +970,7 @@ } // degrees decimal seconds // N 40 26 46 W 79 58 56 - // N 40° 26′ 46″ W, 79° 58′ 56″ + // N 40° 26′ 46″, W 79° 58′ 56″ // 1 2 3 4 5 6 7 8 elseif (preg_match('/\\b([NS])[ ]([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″"]*[, ]+([EW])[ ]([0-9]+)[° ]+([0-9]+)[′\' ]+([0-9]+)[″"]*\\b/', $sQuery, $aData)) {