Skip to content

Commit

Permalink
Fix url parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
osaajani committed Feb 26, 2024
1 parent 6e6c51a commit 064d6fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v3.9.0
v3.9.1
7 changes: 1 addition & 6 deletions descartes/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ public static function url (string $controller, string $method, array $params =
protected static function clean_url (string $url)
{
$to_remove = parse_url(HTTP_PWD, PHP_URL_PATH);
if ($to_remove === null)
{
return $url;
}

$url = mb_strcut($url, mb_strlen($to_remove));
$url = mb_strcut($url, $to_remove ? mb_strlen($to_remove) : 0);
$url = parse_url($url, PHP_URL_PATH);

return $url;
Expand Down

0 comments on commit 064d6fd

Please sign in to comment.