summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/utils
diff options
context:
space:
mode:
authorJonas Kohl2024-09-09 17:57:00 +0200
committerJonas Kohl2024-09-09 17:57:00 +0200
commit34b1b391d4b03659a96f868857c230002b351514 (patch)
tree4173dd2831963d2bf85676de7e821b913640e43a /src/application/mystic/forum/utils
parent415a0a96a76afbe7f1ad2f51862641793caf1b6c (diff)
More updates
Diffstat (limited to 'src/application/mystic/forum/utils')
-rw-r--r--src/application/mystic/forum/utils/RequestUtils.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/application/mystic/forum/utils/RequestUtils.php b/src/application/mystic/forum/utils/RequestUtils.php
new file mode 100644
index 0000000..2f40013
--- /dev/null
+++ b/src/application/mystic/forum/utils/RequestUtils.php
@@ -0,0 +1,19 @@
+<?php
+declare(strict_types=1);
+
+namespace mystic\forum\utils;
+
+use mystic\forum\Messaging;
+
+final class RequestUtils {
+ use StaticClass;
+
+ public static function ensureRequestMethod(string $method): void {
+ $rMethod = $_SERVER["REQUEST_METHOD"];
+ if (strcasecmp($rMethod, $method) !== 0) {
+ http_response_code(500);
+ Messaging::error("Invalid request method $rMethod");
+ exit;
+ }
+ }
+}