File tree 1 file changed +13
-2
lines changed
app/code/Magento/Store/Model
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1182,18 +1182,29 @@ public function getCurrentUrl($fromStore = true)
1182
1182
if (!$ this ->isUseStoreInUrl ()) {
1183
1183
$ storeParsedQuery ['___store ' ] = $ this ->getCode ();
1184
1184
}
1185
+
1185
1186
if ($ fromStore !== false ) {
1186
1187
$ storeParsedQuery ['___from_store ' ] = $ fromStore ===
1187
1188
true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
1188
1189
}
1189
1190
1191
+ $ requestStringParts = explode ('? ' , $ requestString , 2 );
1192
+ $ requestStringPath = $ requestStringParts [0 ];
1193
+ if (isset ($ requestStringParts [1 ])) {
1194
+ parse_str ($ requestStringParts [1 ], $ requestString );
1195
+ } else {
1196
+ $ requestString = [];
1197
+ }
1198
+
1199
+ $ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1200
+
1190
1201
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1191
1202
. ':// '
1192
1203
. $ storeParsedUrl ['host ' ]
1193
1204
. (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
1194
1205
. $ storeParsedUrl ['path ' ]
1195
- . $ requestString
1196
- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1206
+ . $ requestStringPath
1207
+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
1197
1208
1198
1209
return $ currentUrl ;
1199
1210
}
You can’t perform that action at this time.
0 commit comments