Skip to content

Commit 300772d

Browse files
committed
Fix issue 18941
1 parent 0e8cd9f commit 300772d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

app/code/Magento/Store/Model/Store.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,18 +1164,21 @@ public function isDefault()
11641164
* Retrieve current url for store
11651165
*
11661166
* @param bool $fromStore
1167-
* @param bool $clearUrl
11681167
* @return string
11691168
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
11701169
* @SuppressWarnings(PHPMD.NPathComplexity)
11711170
*/
1172-
public function getCurrentUrl($fromStore = true, $clearUrl = false)
1171+
public function getCurrentUrl($fromStore = true)
11731172
{
11741173
$sidQueryParam = $this->_sidResolver->getSessionIdQueryParam($this->_getSession());
11751174
$requestString = $this->_url->escape(ltrim($this->_request->getRequestString(), '/'));
11761175

11771176
$storeUrl = $this->getUrl('', ['_secure' => $this->_storeManager->getStore()->isCurrentlySecure()]);
11781177

1178+
if ($this->_config->getValue(self::XML_PATH_STORE_IN_URL)) {
1179+
$storeUrl = preg_replace('/\/'.$this->getCode().'{1}/','',$storeUrl);
1180+
}
1181+
11791182
if (!filter_var($storeUrl, FILTER_VALIDATE_URL)) {
11801183
return $storeUrl;
11811184
}
@@ -1218,10 +1221,6 @@ public function getCurrentUrl($fromStore = true, $clearUrl = false)
12181221

12191222
$currentUrlQueryParams = array_merge($requestString, $storeParsedQuery);
12201223

1221-
if ($clearUrl !== false) {
1222-
$currentUrlQueryParams = false;
1223-
}
1224-
12251224
$currentUrl = $storeParsedUrl['scheme']
12261225
. '://'
12271226
. $storeParsedUrl['host']

0 commit comments

Comments
 (0)