Skip to content

Commit

Permalink
Merge pull request #2470 in SW/shopware from bugfix/next/sw-11065-fix…
Browse files Browse the repository at this point in the history
…-multiple-virtual-url-replacement to next

* commit '80b987bebfefb5bafa5379a7b5b8e54adec31313':
  SW-11065 - Fix url replacement in router plugin
  • Loading branch information
bcremer committed Apr 20, 2015
2 parents 6789e6b + 80b987b commit 635232e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions engine/Shopware/Plugins/Default/Core/Router/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,12 @@ private function removeShopBaseUrl($requestUri, Request $request, Shop $shop)
*/
private function removePartOfUrl($requestUri, $url)
{
$decode = urldecode($url);
$encode = urlencode($decode);

$temp = rtrim($url, '/') . '/';
switch (true) {
case (strpos($requestUri, $url) === 0):
case (strpos($requestUri, $temp) === 0):
return substr($requestUri, strlen($url));
case ($requestUri == $url):
return substr($requestUri, strlen($url));
case (strpos($requestUri, $decode) === 0):
return substr($requestUri, strlen($decode));
case (strpos($requestUri, $encode) === 0):
return substr($requestUri, strlen($encode));
default:
return $requestUri;
}
Expand Down

0 comments on commit 635232e

Please sign in to comment.