File tree 1 file changed +5
-6
lines changed
app/code/Magento/Store/Model 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -1164,18 +1164,21 @@ public function isDefault()
1164
1164
* Retrieve current url for store
1165
1165
*
1166
1166
* @param bool $fromStore
1167
- * @param bool $clearUrl
1168
1167
* @return string
1169
1168
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
1170
1169
* @SuppressWarnings(PHPMD.NPathComplexity)
1171
1170
*/
1172
- public function getCurrentUrl ($ fromStore = true , $ clearUrl = false )
1171
+ public function getCurrentUrl ($ fromStore = true )
1173
1172
{
1174
1173
$ sidQueryParam = $ this ->_sidResolver ->getSessionIdQueryParam ($ this ->_getSession ());
1175
1174
$ requestString = $ this ->_url ->escape (ltrim ($ this ->_request ->getRequestString (), '/ ' ));
1176
1175
1177
1176
$ storeUrl = $ this ->getUrl ('' , ['_secure ' => $ this ->_storeManager ->getStore ()->isCurrentlySecure ()]);
1178
1177
1178
+ if ($ this ->_config ->getValue (self ::XML_PATH_STORE_IN_URL )) {
1179
+ $ storeUrl = preg_replace ('/\/ ' .$ this ->getCode ().'{1}/ ' ,'' ,$ storeUrl );
1180
+ }
1181
+
1179
1182
if (!filter_var ($ storeUrl , FILTER_VALIDATE_URL )) {
1180
1183
return $ storeUrl ;
1181
1184
}
@@ -1218,10 +1221,6 @@ public function getCurrentUrl($fromStore = true, $clearUrl = false)
1218
1221
1219
1222
$ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1220
1223
1221
- if ($ clearUrl !== false ) {
1222
- $ currentUrlQueryParams = false ;
1223
- }
1224
-
1225
1224
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1226
1225
. ':// '
1227
1226
. $ storeParsedUrl ['host ' ]
You can’t perform that action at this time.
0 commit comments