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:
Sarah Hoffmann
2016-06-11 23:07:06 +02:00
parent aa9fff9199
commit d45524cbfb
9 changed files with 153 additions and 141 deletions

View File

@@ -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;