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 @@ -1166,18 +1166,29 @@ public function getCurrentUrl($fromStore = true)
1166
1166
if (!$ this ->isUseStoreInUrl ()) {
1167
1167
$ storeParsedQuery ['___store ' ] = $ this ->getCode ();
1168
1168
}
1169
+
1169
1170
if ($ fromStore !== false ) {
1170
1171
$ storeParsedQuery ['___from_store ' ] = $ fromStore ===
1171
1172
true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
1172
1173
}
1173
1174
1175
+ $ requestStringParts = explode ('? ' , $ requestString , 2 );
1176
+ $ requestStringPath = $ requestStringParts [0 ];
1177
+ if (isset ($ requestStringParts [1 ])) {
1178
+ parse_str ($ requestStringParts [1 ], $ requestString );
1179
+ } else {
1180
+ $ requestString = [];
1181
+ }
1182
+
1183
+ $ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1184
+
1174
1185
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1175
1186
. ':// '
1176
1187
. $ storeParsedUrl ['host ' ]
1177
1188
. (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
1178
1189
. $ storeParsedUrl ['path ' ]
1179
- . $ requestString
1180
- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1190
+ . $ requestStringPath
1191
+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
1181
1192
1182
1193
return $ currentUrl ;
1183
1194
}
You can’t perform that action at this time.
0 commit comments