summaryrefslogtreecommitdiff
path: root/src/web/core/router.php
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-10-20 16:49:11 -0400
committerFreya Murphy <freya@freyacat.org>2024-10-20 16:49:11 -0400
commitcec4fb7ede7fee7b5621c096f3d5a4863b7b484e (patch)
tree9f0af211e9b2f9035220d94d07cd8edf381f61c1 /src/web/core/router.php
parentupdate john (diff)
downloadwebsite-cec4fb7ede7fee7b5621c096f3d5a4863b7b484e.tar.gz
website-cec4fb7ede7fee7b5621c096f3d5a4863b7b484e.tar.bz2
website-cec4fb7ede7fee7b5621c096f3d5a4863b7b484e.zip
refactor config and add allowed_hosts
Diffstat (limited to 'src/web/core/router.php')
-rw-r--r--src/web/core/router.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web/core/router.php b/src/web/core/router.php
index 2cda384..a1307cf 100644
--- a/src/web/core/router.php
+++ b/src/web/core/router.php
@@ -30,7 +30,8 @@ class Router extends Component {
$path = substr($path, 1);
// get modified route
- foreach ($GLOBALS['routes'] as $key => $value) {
+ $routes = CONFIG['routes'];
+ foreach ($routes as $key => $value) {
$key = "/^{$key}$/";
if (!preg_match($key, $path, $matches))
continue;
@@ -83,7 +84,6 @@ class Router extends Component {
'args' => array_slice($parts, 2),
);
- $routes = $GLOBALS['routes'];
if (isset($routes[$path])) {
$parts = explode('/', $routes[$path]);
if (count($parts) == 1) {