From fbd84203994d5af53ef063aa21df52710958f372 Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 9 Dec 2016 11:43:23 +0200 Subject: [PATCH] -Url ru - ua hot fix --- CatalogUrlManager.php | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/CatalogUrlManager.php b/CatalogUrlManager.php index 8d7b103..f4871da 100755 --- a/CatalogUrlManager.php +++ b/CatalogUrlManager.php @@ -5,6 +5,7 @@ use artweb\artbox\ecommerce\models\Category; use artweb\artbox\ecommerce\models\Product; use artweb\artbox\ecommerce\models\ProductVariant; + use yii\helpers\VarDumper; use yii\web\HttpException; use yii\web\UrlRuleInterface; @@ -23,6 +24,12 @@ */ public function parseRequest($manager, $request) { + /** + * Fast url fix + */ + if (!preg_match('@^\/(ru|ua).*@i', $request->url) && $request->url !== '/') { + throw new HttpException(404, 'Page not found'); + } $pathInfo = $request->getPathInfo(); $paths = explode('/', $pathInfo); -- libgit2 0.21.4