From a607d74c3080cff5a9a9f4362f6da491982e8a6e Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Tue, 27 Jun 2017 01:39:02 -0400 Subject: Add function isAction() --- app/class/globals.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'app/class') diff --git a/app/class/globals.php b/app/class/globals.php index 615efa6..94df716 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -76,6 +76,17 @@ function require_https() : void redirect("https://" . $_SERVER['SERVER_NAME'] . ap()); } +/* + * 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; +} + /* * Check for errors, warnings, or notices */ -- cgit v1.2.3