diff options
Diffstat (limited to 'inc/request.inc.php')
-rw-r--r-- | inc/request.inc.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/inc/request.inc.php b/inc/request.inc.php index a2dc9711..6104fafd 100644 --- a/inc/request.inc.php +++ b/inc/request.inc.php @@ -6,9 +6,17 @@ class Request { + /** + * Required and not empty + */ const REQUIRED = "\0\1\2REQ\0\1\2"; /** + * Required, but might be empty + */ + const REQUIRED_EMPTY = "\0\3\4REQ\0\3\4"; + + /** * * @param string $key Key of field to get from $_GET * @param string $default Value to return if $_GET does not contain $key @@ -61,7 +69,7 @@ class Request private static function handle(&$array, $key, $default, $type) { if (!isset($array[$key])) { - if ($default === self::REQUIRED) { + if ($default === self::REQUIRED || $default === self::REQUIRED_EMPTY) { Message::addError('main.parameter-missing', $key); Util::redirect('?do=' . $_REQUEST['do']); } |