mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
introduce accessor function for URL parameter
These functions take care of type conversion and check that the parameters contain legal values. The API now returns a Bad Request error if the format is wrong.
This commit is contained in:
@@ -39,13 +39,6 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
function getParamBool($name, $default=false)
|
||||
{
|
||||
if (!isset($_GET[$name])) return $default;
|
||||
|
||||
return (bool) $_GET[$name];
|
||||
}
|
||||
|
||||
function fail($sError, $sUserError = false)
|
||||
{
|
||||
if (!$sUserError) $sUserError = $sError;
|
||||
|
||||
Reference in New Issue
Block a user