From e7a6b9cebe7464d0a2c0916d1d173f6893599019 Mon Sep 17 00:00:00 2001 From: Arsen Mirzaev Tatyano-Muradovich Date: Fri, 4 Mar 2022 02:15:42 +1000 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=BC=D0=B0?= =?UTF-8?q?=D1=80=D1=88=D1=80=D1=83=D1=82=D0=B0=20=D0=BD=D0=B0=20=D0=B3?= =?UTF-8?q?=D0=BB=D0=B0=D0=B2=D0=BD=D1=83=D1=8E=20=D1=81=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/minimal/system/router.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mirzaev/minimal/system/router.php b/mirzaev/minimal/system/router.php index 95efcd8..3235c02 100644 --- a/mirzaev/minimal/system/router.php +++ b/mirzaev/minimal/system/router.php @@ -100,6 +100,9 @@ final class router // Реиницилазция маршрута $route = self::universalization(implode('/', $data['directories'])); + // Маршрут оказался пустым + if (empty($route)) $route = '/'; + if (mb_stripos($route, $url, 0, "UTF-8") === 0 && mb_strlen($route, 'UTF-8') <= mb_strlen($url, 'UTF-8')) { // Найден маршрут, а так же его длина не меньше длины запрошенного URL @@ -191,7 +194,7 @@ final class router $url = preg_replace('/^([^\/])/', '/$1', $url); // Если записан "/" в конце, то удалить - $url = preg_replace('/(.*)\/$/', '$1', $url); + $url = preg_replace('/(.+)\/$/', '$1', $url); return $url; }