Skip to content

Commit

Permalink
Fixes to routing
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed May 13, 2023
1 parent 85769c1 commit da4e18c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -29,7 +29,7 @@

$uri = $_SERVER['REQUEST_URI'];
if(false !== strpos($uri, 'index.php')) {
$uri = str_replace_first('index.php', '', $uri);
$uri = str_replace_first('/index.php', '', $uri);
}

if(0 === strpos($uri, '/')) {
Expand Down
6 changes: 5 additions & 1 deletion system/router.php
Expand Up @@ -51,7 +51,11 @@
$uri = rawurldecode($uri);
if (BASE_DIR !== '') {
$tmp = str_replace_first('/', '', BASE_DIR);
$uri = str_replace_first($tmp . '/', '', $uri);
$uri = str_replace_first($tmp, '', $uri);
}

if(0 === strpos($uri, '/')) {
$uri = str_replace_first('/', '', $uri);
}

define('URI', $uri);
Expand Down

0 comments on commit da4e18c

Please sign in to comment.