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 @@ -1166,18 +1166,29 @@ public function getCurrentUrl($fromStore = true)
11661166 if (!$ this ->isUseStoreInUrl ()) {
11671167 $ storeParsedQuery ['___store ' ] = $ this ->getCode ();
11681168 }
1169+
11691170 if ($ fromStore !== false ) {
11701171 $ storeParsedQuery ['___from_store ' ] = $ fromStore ===
11711172 true ? $ this ->_storeManager ->getStore ()->getCode () : $ fromStore ;
11721173 }
11731174
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+
11741185 $ currentUrl = $ storeParsedUrl ['scheme ' ]
11751186 . ':// '
11761187 . $ storeParsedUrl ['host ' ]
11771188 . (isset ($ storeParsedUrl ['port ' ]) ? ': ' . $ storeParsedUrl ['port ' ] : '' )
11781189 . $ storeParsedUrl ['path ' ]
1179- . $ requestString
1180- . ($ storeParsedQuery ? '? ' . http_build_query ($ storeParsedQuery , '' , '& ' ) : '' );
1190+ . $ requestStringPath
1191+ . ($ currentUrlQueryParams ? '? ' . http_build_query ($ currentUrlQueryParams , '' , '& ' ) : '' );
11811192
11821193 return $ currentUrl ;
11831194 }
You can’t perform that action at this time.
0 commit comments