From 184d03a214f96fb802266988be90b577024ee310 Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 15 Oct 2021 17:41:47 -0400 Subject: [PATCH] Fix error on undefined param. --- src/Libs/Router.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Libs/Router.php b/src/Libs/Router.php index 981a9e3..20ee6de 100644 --- a/src/Libs/Router.php +++ b/src/Libs/Router.php @@ -261,10 +261,11 @@ class Router { break; } + $args = static::getReq(); + foreach ($routers as $router) { // revisa todos los routers para ver si coinciden con la URI actual if (preg_match_all('/^'.$router['path'].'\/?$/si',$uri, $matches, PREG_PATTERN_ORDER)) { unset($matches[0]); - $args = static::getReq(); // Comprobando pseudo variables en URI if (isset($matches[1])) { @@ -292,7 +293,7 @@ class Router { } // Si no hay router que coincida llamamos a $notFoundCallBack - call_user_func_array(static::$notFoundCallBack, [$req]); + call_user_func_array(static::$notFoundCallBack, [$args]); } } ?>