check if file exists

(cherry picked from commit 52bd27a0280c736e563ccc67a9307cd75bd14d3f)
This commit is contained in:
Mario 2019-11-13 13:40:40 +00:00
parent 3a2fdec241
commit c850a61a89

View File

@ -56,7 +56,7 @@ class Router {
$routes = Route::get();
if($routes) {
foreach($routes as $route) {
if(is_array($route) && strtolower($route[1]) === $module) {
if(is_array($route) && file_exists($route[0]) && strtolower($route[1]) === $module) {
include_once($route[0]);
if(class_exists($modname)) {
$this->controller = new $modname;