diff --git a/src/Venom/Routing/Router.php b/src/Venom/Routing/Router.php index 96e3881..ca5a5ce 100644 --- a/src/Venom/Routing/Router.php +++ b/src/Venom/Routing/Router.php @@ -106,10 +106,13 @@ class Router public function tryFunctionCall(?array $aRoute): bool { - if ($aRoute === null || !is_callable(array($aRoute['cl'], $aRoute['fnc']))) { + if ($aRoute === null || empty($aRoute['cl']) || empty($aRoute['fnc']) || !class_exists($aRoute['cl'])) { return false; } $route = new $aRoute['cl'](); + if (!is_callable(array($route, $aRoute['fnc']))) { + return false; + } try { $fnc = $aRoute['fnc']; $params = $aRoute['params'] ?? [];