Skip to content

Commit

Permalink
Bug fixed about query params in route paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
izniburak committed Nov 29, 2020
1 parent 3e6d43c commit 70e16b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,10 @@ protected function clearRouteName(string $route = ''): string
*/
protected function getRequestUri(): string
{
$dirname = dirname($_SERVER['SCRIPT_NAME']);
$dirname = dirname($this->request()->server->get('SCRIPT_NAME'));
$dirname = $dirname === '/' ? '' : $dirname;
$basename = basename($_SERVER['SCRIPT_NAME']);
return $this->clearRouteName(str_replace([$dirname, $basename], null, $_SERVER['REQUEST_URI']));
$uri = str_replace([$dirname, $basename],null, $this->request()->server->get('REQUEST_URI'));
return $this->clearRouteName(explode('?', $uri)[0]);
}
}

0 comments on commit 70e16b9

Please sign in to comment.