From 841b16266a5fda21e8a38d9a7be767169797474c Mon Sep 17 00:00:00 2001 From: Antonio de la Rosa Date: Sun, 1 May 2022 00:46:36 +0200 Subject: [PATCH] Fixes in index.php --- libraries/Routes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/Routes.php b/libraries/Routes.php index e7c1ba6..861b707 100644 --- a/libraries/Routes.php +++ b/libraries/Routes.php @@ -7,7 +7,7 @@ class Config { static public $home_module='welcome'; - static public $modules_allowed=['welcome' => true]; + static public $modules_allowed=['welcome']; } @@ -52,7 +52,7 @@ function get_route($path_info) { $controller='modules/'.$arr_path[1].'/controllers/index.php'; - if(Config::$modules_allowed[$arr_path[1]]) { + if(in_array($arr_path[1], Config::$modules_allowed)) { return \PhangoApp\PhaRouter\get_controller($controller, []); @@ -64,7 +64,7 @@ function get_route($path_info) { $controller='modules/'.$arr_path[1].'/controllers/'.$arr_path[2].'.php'; - if(Config::$modules_allowed[$arr_path[1]]) { + if(in_array($arr_path[1], Config::$modules_allowed)) { return \PhangoApp\PhaRouter\get_controller($controller, []); @@ -76,7 +76,7 @@ function get_route($path_info) { $controller='modules/'.$arr_path[1].'/controllers/'.$arr_path[2].'.php'; - if(Config::$modules_allowed[$arr_path[1]]) { + if(in_array($arr_path[1], Config::$modules_allowed)) { $args=array_slice($arr_path, 2, count($arr_path));