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