From 064d6fd941f88fd73862c29e69cdbc5a26e89982 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Mon, 26 Feb 2024 12:07:03 +0100 Subject: [PATCH] Fix url parsing --- VERSION | 2 +- descartes/Router.php | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 5f22788..a4dae04 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v3.9.0 +v3.9.1 diff --git a/descartes/Router.php b/descartes/Router.php index 5b78a05..ce421e9 100644 --- a/descartes/Router.php +++ b/descartes/Router.php @@ -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;