Explorar el Código

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

Example: /sitemap.xml, /sitemap1.xml, /sitemap542.xml
Visman hace 1 año
padre
commit
5ebf9eb3f6
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  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) {