diff options
author | Malf Furious <m@lfurio.us> | 2018-01-24 23:41:23 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2018-01-24 23:41:23 -0500 |
commit | b8351dc9d172b8b00479066dab56c97874ad501c (patch) | |
tree | 25f0cbcb772a88847b5a8d67bd880ddf2f8ca33a /app/class/globals.php | |
parent | 306d3d2b7b8538a5c2d1c8fc26852e83214725d0 (diff) | |
parent | 75dd0e67ca684f779b712b313f188d23f903609f (diff) | |
download | scrott-b8351dc9d172b8b00479066dab56c97874ad501c.tar.gz scrott-b8351dc9d172b8b00479066dab56c97874ad501c.zip |
Merge branch 'feature/ui-basics' into dev
Diffstat (limited to 'app/class/globals.php')
-rw-r--r-- | app/class/globals.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/class/globals.php b/app/class/globals.php index 615efa6..776fc35 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -77,6 +77,28 @@ function require_https() : void } /* + * Check whether an action string was submitted by the user agent + */ +function isAction(string $action) : bool +{ + if (!isset($_REQUEST['action'])) + return false; + + return $_REQUEST['action'] == $action; +} + +/* + * Get an array of submitted form input + */ +function input() : array +{ + if (!isset($_REQUEST['input'])) + throw new Exception("Requested form input, but no input data was supplied"); + + return $_REQUEST['input']; +} + +/* * Check for errors, warnings, or notices */ function isError(string $level) : bool |