From 7e1993730afff38d19cb08679ca83020de8a6c70 Mon Sep 17 00:00:00 2001 From: RedHood Date: Sat, 5 Dec 2020 23:28:55 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=20=D0=BC=D0=B0=D1=80=D1=88=D1=80=D1=83?= =?UTF-8?q?=D1=82=D0=B8=D0=B7=D0=B0=D1=82=D0=BE=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.json | 6 ++++-- mirzaev/beejee/system/router.php | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 657c388..1342b43 100644 --- a/composer.json +++ b/composer.json @@ -33,8 +33,10 @@ }, "scripts": { "post-update-cmd": [ - "cp -R vendor/twbs/bootstrap/dist/css mirzaev/beejee/system/public/css/bootstrap", - "cp -R vendor/twbs/bootstrap/dist/js mirzaev/beejee/system/public/js/bootstrap" + "mkdir -p .\\mirzaev\\beejee\\system\\web\\css\\bootstrap > /dev/null 2>&1 || true", + "mkdir -p .\\mirzaev\\beejee\\system\\web\\js\\bootstrap > /dev/null 2>&1 || true", + "cp -R .\\vendor\\twbs\\bootstrap\\dist\\css\\* .\\mirzaev\\beejee\\system\\web\\css\\bootstrap", + "cp -R .\\vendor\\twbs\\bootstrap\\dist\\js\\* .\\\\mirzaev\\beejee\\system\\web\\js\\bootstrap" ] } } \ No newline at end of file diff --git a/mirzaev/beejee/system/router.php b/mirzaev/beejee/system/router.php index c3d254f..fc4c35b 100644 --- a/mirzaev/beejee/system/router.php +++ b/mirzaev/beejee/system/router.php @@ -66,6 +66,11 @@ final class router foreach (self::$routes as $key => $value) { // Если не записан "/" в начале, то записать $route_name = preg_replace('/^([^\/])/', '/$1', $key); + $url = preg_replace('/^([^\/])/', '/$1', $url); + + // Если не записан "/" в конце, то записать + $route_name = preg_replace('/([^\/])$/', '$1/', $route_name); + $url = preg_replace('/([^\/])$/', '$1/', $url); if (mb_stripos($route_name, $url, 0, "UTF-8") === 0 && mb_strlen($route_name, 'UTF-8') <= mb_strlen($url, 'UTF-8')) { // Если найден маршрут, а так же его длина не меньше длины запрошенного URL