aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Main.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Main.php b/src/Main.php
index c82a334..21c7a95 100644
--- a/src/Main.php
+++ b/src/Main.php
@@ -29,10 +29,19 @@ class Main implements Entrypoint
$r->addRoute(["GET"], "/attachments/{id}", AttachmentHandler::class);
}
+ private static function populateGET(): void
+ {
+ $parts = explode("?", $_SERVER["REQUEST_URI"]);
+ if (isset($parts[1]))
+ parse_str($parts[1], $_GET);
+ }
+
public function run(Env $env)
{
$disp = simpleDispatcher(Closure::fromCallable([self::class, "buildRoutes"]));
+ self::populateGET();
+
$uri = preg_replace('/\?.*$/', "", $_SERVER["REQUEST_URI"]);
$result = $disp->dispatch($_SERVER["REQUEST_METHOD"], $uri);
switch ($result[0]) {