From cec4fb7ede7fee7b5621c096f3d5a4863b7b484e Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sun, 20 Oct 2024 16:49:11 -0400 Subject: refactor config and add allowed_hosts --- src/web/core/router.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/web/core/router.php') 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) { -- cgit v1.2.3-freya