Commit fbd84203994d5af53ef063aa21df52710958f372

Authored by Alexey Boroda
1 parent ee2ceed3

-Url ru - ua hot fix

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
CatalogUrlManager.php
... ... @@ -5,6 +5,7 @@
5 5 use artweb\artbox\ecommerce\models\Category;
6 6 use artweb\artbox\ecommerce\models\Product;
7 7 use artweb\artbox\ecommerce\models\ProductVariant;
  8 + use yii\helpers\VarDumper;
8 9 use yii\web\HttpException;
9 10 use yii\web\UrlRuleInterface;
10 11  
... ... @@ -23,6 +24,12 @@
23 24 */
24 25 public function parseRequest($manager, $request)
25 26 {
  27 + /**
  28 + * Fast url fix
  29 + */
  30 + if (!preg_match('@^\/(ru|ua).*@i', $request->url) && $request->url !== '/') {
  31 + throw new HttpException(404, 'Page not found');
  32 + }
26 33  
27 34 $pathInfo = $request->getPathInfo();
28 35 $paths = explode('/', $pathInfo);
... ...