Version 0.9.5 beta - Core update fixed ? and / parameters for the url, now accepting with and without ending / also containing ?

This commit is contained in:
Stephan Kasdorf
2020-11-04 00:22:03 +01:00
parent bee0a7012f
commit 7b71fba0d5
2 changed files with 8 additions and 4 deletions

View File

@@ -48,9 +48,12 @@ final class Dispatcher
{ {
$action = $_REQUEST['_action']."Action"; $action = $_REQUEST['_action']."Action";
$controller->navigationAction(); $controller->navigationAction();
if(method_exists($controller, $action)) if($action!="Action" && !strstr($action, '?'))
{ {
$controller->$action(); if(method_exists($controller, $action))
{
$controller->$action();
}
} }
$controller->pageAction(); $controller->pageAction();
} }

View File

@@ -148,7 +148,8 @@ class Router extends Config
private static function setCurPage( ) private static function setCurPage( )
{ {
$params = false; $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(is_array($uri_parts))
{ {
if($uri_parts[1] == "") if($uri_parts[1] == "")
@@ -158,7 +159,7 @@ class Router extends Config
else else
{ {
self::$_cur_page = $uri_parts[1]; 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]); self::setAction($uri_parts[2]);
$params = true; $params = true;