File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/code/Magento/Store/Model Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1160,18 +1160,29 @@ public function getCurrentUrl($fromStore = true)
1160
1160
if (!$ this ->isUseStoreInUrl ()) {
1161
1161
$ storeParsedQuery ['___store ' ] = $ this ->getCode ();
1162
1162
}
1163
+
1163
1164
if ($ fromStore !== false ) {
1164
1165
$ storeParsedQuery ['___from_store ' ] = $ fromStore ===
1165
1166
true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
1166
1167
}
1167
1168
1169
+ $ requestStringParts = explode ('? ' , $ requestString , 2 );
1170
+ $ requestStringPath = $ requestStringParts [0 ];
1171
+ if (isset ($ requestStringParts [1 ])) {
1172
+ parse_str ($ requestStringParts [1 ], $ requestString );
1173
+ } else {
1174
+ $ requestString = [];
1175
+ }
1176
+
1177
+ $ currentUrlQueryParams = array_merge ($ requestString , $ storeParsedQuery );
1178
+
1168
1179
$ currentUrl = $ storeParsedUrl ['scheme ' ]
1169
1180
. ':// '
1170
1181
. $ storeParsedUrl ['host ' ]
1171
1182
. (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
1172
1183
. $ storeParsedUrl ['path ' ]
1173
- . $ requestString
1174
- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1184
+ . $ requestStringPath
1185
+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
1175
1186
1176
1187
return $ currentUrl ;
1177
1188
}
You can’t perform that action at this time.
0 commit comments