Browse Source

Core\Router: Fix for dynamic files in the forum root

Example: /sitemap.xml, /sitemap1.xml, /sitemap542.xml
Visman 1 year ago
parent
commit
5ebf9eb3f6
1 changed files with 6 additions and 1 deletions
  1. 6 1
      app/Core/Router.php

+ 6 - 1
app/Core/Router.php

@@ -234,7 +234,12 @@ class Router
         }
 
         $pos  = \strpos($uri, '/', 1);
-        $base = false === $pos ? $uri : \substr($uri, 0, $pos);
+
+        if (false === $pos) {
+            $base = isset($this->dynamic[$uri]) ? $uri : '/';
+        } else {
+            $base = \substr($uri, 0, $pos);
+        }
 
         if (isset($this->dynamic[$base])) {
             foreach ($this->dynamic[$base] as $pattern => $data) {