Skip to content

Commit bbf7a45

Browse files
lazyguruadamwathan
authored andcommitted
Add support for versions path in URLs added in Magento 2.1.3
1 parent 953d828 commit bbf7a45

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cli/drivers/Magento2ValetDriver.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function isStaticFile($sitePath, $siteName, $uri)
3535
{
3636
$this->checkMageMode($sitePath);
3737

38+
$uri = $this->handleForVersions($uri);
3839
$route = parse_url(substr($uri, 1))['path'];
3940

4041
$pub = '';
@@ -72,6 +73,17 @@ public function isStaticFile($sitePath, $siteName, $uri)
7273
return false;
7374
}
7475

76+
/**
77+
* Rewrite URLs that look like "versions12345/" to remove
78+
* the versions12345/ part
79+
*
80+
* @param string $route
81+
*/
82+
private function handleForVersions($route)
83+
{
84+
return preg_replace('/version\d*\//', '', $route);
85+
}
86+
7587
/**
7688
* Determine the current MAGE_MODE
7789
*

0 commit comments

Comments
 (0)