diff --git a/index.php b/index.php index 1885b7ae..b3419884 100644 --- a/index.php +++ b/index.php @@ -146,14 +146,6 @@ if (isset($api)) { */ $url = new URL($_SERVER['REQUEST_URI']); -if ($url->isPretty()) { - $_SESSION['_GET'] = query_to_key_value_pair($url->getPermalink()); -} - -if ($_SERVER['QUERY_STRING']) { - $_SESSION['_GET'] = $_GET; -} - /** * Install */ @@ -174,7 +166,7 @@ if ($options && $options->getOption('isInstalled') && !(defined('ENV_IS_DEV') && * Page */ if (!isset($page)) { - $page = isset($_SESSION['_GET']['page']) ? $_SESSION['_GET']['page'] : 'home'; + $page = isset($_GET['page']) ? $_GET['page'] : 'home'; } $pagePath = 'src/pages/' . $page . '.php'; diff --git a/src/classes/page.php b/src/classes/page.php index d1a5786a..078d221b 100644 --- a/src/classes/page.php +++ b/src/classes/page.php @@ -151,10 +151,9 @@ class Page if ( !isset($_SESSION['user']) - && isset($_SESSION['_GET']['page']) - && !in_array($_SESSION['_GET']['page'], $ignorePower) + && isset($_GET['page']) + && !in_array($_GET['page'], $ignorePower) ) { - $_SESSION['REDIRECT_URL'] = $_SERVER['REQUEST_URI']; redirect(Page::PAGE_LOGIN); } @@ -186,10 +185,10 @@ class Page /** * Redirect */ - if ($options && $options->getOption('isInstalled') && isset($_SESSION['_GET'])) { - $url = new URL(http_build_query($_SESSION['_GET'])); + if ($options && $options->getOption('isInstalled') && isset($_GET)) { + $url = new URL(http_build_query($_GET)); - if (false === $url->isPretty()) { + if ($url->url && false === $url->isPretty()) { redirect($url->getPretty()); } } @@ -329,7 +328,7 @@ class Page ?>