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 @@ -1182,18 +1182,29 @@ public function getCurrentUrl($fromStore = true)
11821182 if (!$ this ->isUseStoreInUrl ()) {
11831183 $ storeParsedQuery ['___store ' ] = $ this ->getCode ();
11841184 }
1185+
11851186 if ($ fromStore !== false ) {
11861187 $ storeParsedQuery ['___from_store ' ] = $ fromStore ===
11871188 true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
11881189 }
11891190
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+
11901201 $ currentUrl = $ storeParsedUrl ['scheme ' ]
11911202 . ':// '
11921203 . $ storeParsedUrl ['host ' ]
11931204 . (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
11941205 . $ storeParsedUrl ['path ' ]
1195- . $ requestString
1196- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1206+ . $ requestStringPath
1207+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
11971208
11981209 return $ currentUrl ;
11991210 }
You can’t perform that action at this time.
0 commit comments