summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/class/globals.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/class/globals.php b/app/class/globals.php
index ab82edd..c81c9a2 100644
--- a/app/class/globals.php
+++ b/app/class/globals.php
@@ -69,11 +69,14 @@ function redirect(string $url) : void
/*
* Redirect to the given in-app URL and die. The given URL should be a path
- * relative to the app root.
+ * relative to the app root. No argument reloads the current path.
*/
-function location(string $path) : void
+function location(?string $path = NULL) : void
{
- redirect(ar() . $path);
+ if ($path)
+ redirect(ar() . $path);
+ else
+ redirect(ap());
}
/*