Skip to content

Commit 0e8cd9f

Browse files
committed
Calling getCurrentUrl on Store will wrongly add "___store"
1 parent 2a389b0 commit 0e8cd9f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,11 +1164,12 @@ public function isDefault()
11641164
* Retrieve current url for store
11651165
*
11661166
* @param bool $fromStore
1167+
* @param bool $clearUrl
11671168
* @return string
11681169
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
11691170
* @SuppressWarnings(PHPMD.NPathComplexity)
11701171
*/
1171-
public function getCurrentUrl($fromStore = true)
1172+
public function getCurrentUrl($fromStore = true, $clearUrl = false)
11721173
{
11731174
$sidQueryParam = $this->_sidResolver->getSessionIdQueryParam($this->_getSession());
11741175
$requestString = $this->_url->escape(ltrim($this->_request->getRequestString(), '/'));
@@ -1217,6 +1218,10 @@ public function getCurrentUrl($fromStore = true)
12171218

12181219
$currentUrlQueryParams = array_merge($requestString, $storeParsedQuery);
12191220

1221+
if ($clearUrl !== false) {
1222+
$currentUrlQueryParams = false;
1223+
}
1224+
12201225
$currentUrl = $storeParsedUrl['scheme']
12211226
. '://'
12221227
. $storeParsedUrl['host']

0 commit comments

Comments
 (0)