X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/95961d098da553a335c9c44dc6a9827b83e7fc99..feb458f8dd4c897f3aa688943d75dbf58bc090f5:/lib/website.php diff --git a/lib/website.php b/lib/website.php index 22ec08f1..a6afb698 100644 --- a/lib/website.php +++ b/lib/website.php @@ -39,7 +39,7 @@ INTERNALFAIL; echo "
\n".$oSql->getUserInfo()."
"; } - echo "

"; + echo "

"; exit; } @@ -76,7 +76,7 @@ INTERNALFAIL; header('Content-type: text/html; charset=utf-8'); echo "

Bad Request

"; echo '

Nominatim has encountered an error with your request.

'; - echo "

Details: ".$sError,"

"; + echo "

Details: ".$sError."

"; echo '

If you feel this error is incorrect feel file an issue on Github. Please include the error message above and the URL you used.

'; echo "\n\n"; exit; @@ -91,16 +91,16 @@ INTERNALFAIL; function getParamBool($sName, $bDefault=false) { - if (!isset($_GET[$sName])) return $bDefault; + if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault; return (bool) $_GET[$sName]; } function getParamInt($sName, $bDefault=false) { - if (!isset($_GET[$sName])) return $bDefault; + if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault; - if (!preg_match('/^[+-][0-9]+$/', $_GET[$sName])) + if (!preg_match('/^[+-]?[0-9]+$/', $_GET[$sName])) { userError("Integer number expected for parameter '$sName'"); } @@ -110,7 +110,7 @@ INTERNALFAIL; function getParamFloat($sName, $bDefault=false) { - if (!isset($_GET[$sName])) return $bDefault; + if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault; if (!preg_match('/^[+-]?[0-9]*\.?[0-9]+$/', $_GET[$sName])) { @@ -122,14 +122,14 @@ INTERNALFAIL; function getParamString($sName, $bDefault=false) { - if (!isset($_GET[$sName])) return $bDefault; + if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $bDefault; return $_GET[$sName]; } function getParamSet($sName, $aValues, $sDefault=false) { - if (!isset($_GET[$sName])) return $sDefault; + if (!isset($_GET[$sName]) || strlen($_GET[$sName]) == 0) return $sDefault; if (!in_array($_GET[$sName], $aValues)) {