From 7b71fba0d53eb525916311ca24e9251b58927c3b Mon Sep 17 00:00:00 2001 From: Stephan Kasdorf Date: Wed, 4 Nov 2020 00:22:03 +0100 Subject: [PATCH] Version 0.9.5 beta - Core update fixed ? and / parameters for the url, now accepting with and without ending / also containing ? --- core/c/dispatcher.php | 7 +++++-- core/c/router.php | 5 +++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/c/dispatcher.php b/core/c/dispatcher.php index c411438..7450e6e 100644 --- a/core/c/dispatcher.php +++ b/core/c/dispatcher.php @@ -48,9 +48,12 @@ final class Dispatcher { $action = $_REQUEST['_action']."Action"; $controller->navigationAction(); - if(method_exists($controller, $action)) + if($action!="Action" && !strstr($action, '?')) { - $controller->$action(); + if(method_exists($controller, $action)) + { + $controller->$action(); + } } $controller->pageAction(); } diff --git a/core/c/router.php b/core/c/router.php index f6213b6..a6c2442 100755 --- a/core/c/router.php +++ b/core/c/router.php @@ -148,7 +148,8 @@ class Router extends Config private static function setCurPage( ) { $params = false; - $uri_parts = explode('/', $_SERVER["REQUEST_URI"]); + $param_parts = explode('?', $_SERVER["REQUEST_URI"]); + $uri_parts = explode('/', $param_parts[0]); if(is_array($uri_parts)) { if($uri_parts[1] == "") @@ -158,7 +159,7 @@ class Router extends Config else { self::$_cur_page = $uri_parts[1]; - if(array_key_exists(2, $uri_parts)) + if(array_key_exists(2, $uri_parts) && $uri_parts[2]!="") { self::setAction($uri_parts[2]); $params = true;