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 @@ -1158,18 +1158,21 @@ public function isDefault()
1158
1158
* Retrieve current url for store
1159
1159
*
1160
1160
* @param bool $fromStore
1161
- * @param bool $clearUrl
1162
1161
* @return string
1163
1162
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
1164
1163
* @SuppressWarnings(PHPMD.NPathComplexity)
1165
1164
*/
1166
- public function getCurrentUrl ($ fromStore = true , $ clearUrl = false )
1165
+ public function getCurrentUrl ($ fromStore = true )
1167
1166
{
1168
1167
$ sidQueryParam = $ this ->_sidResolver ->getSessionIdQueryParam ($ this ->_getSession ());
1169
1168
$ requestString = $ this ->_url ->escape (ltrim ($ this ->_request ->getRequestString (), '/ ' ));
1170
1169
1171
1170
$ storeUrl = $ this ->getUrl ('' , ['_secure ' => $ this ->_storeManager ->getStore ()->isCurrentlySecure ()]);
1172
1171
1172
+ if ($ this ->_config ->getValue (self ::XML_PATH_STORE_IN_URL )) {
1173
+ $ storeUrl = preg_replace ('/\/ ' .$ this ->getCode ().'{1}/ ' ,'' ,$ storeUrl );
1174
+ }
1175
+
1173
1176
if (!filter_var ($ storeUrl , FILTER_VALIDATE_URL )) {
1174
1177
return $ storeUrl ;
1175
1178
}
@@ -1212,10 +1215,6 @@ public function getCurrentUrl($fromStore = true, $clearUrl = false)
1212
1215
1213
1216
$ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1214
1217
1215
- if ($ clearUrl !== false ) {
1216
- $ currentUrlQueryParams = false ;
1217
- }
1218
-
1219
1218
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1220
1219
. ':// '
1221
1220
. $ storeParsedUrl ['host ' ]
You can’t perform that action at this time.
0 commit comments