Skip to content

Commit 7c8733c

Browse files
committed
Build query string array from url stripped of marketing params instead of original request uri.
1 parent 0a3b703 commit 7c8733c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

lib/internal/Magento/Framework/App/PageCache/Identifier.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,22 @@ private function reconstructUrl(string $url): array
106106
if (empty($url)) {
107107
return [$url, ''];
108108
}
109+
109110
$baseUrl = strtok($url, '?');
110-
$query = $this->request->getUri()->getQueryAsArray();
111-
if (!empty($query)) {
112-
ksort($query);
113-
$query = http_build_query($query);
111+
$queryString = parse_url($url, PHP_URL_QUERY) ?? '';
112+
113+
$queryArray = [];
114+
if ($queryString !== '') {
115+
parse_str($queryString, $queryArray);
116+
}
117+
118+
if (!empty($queryArray)) {
119+
ksort($queryArray);
120+
$query = http_build_query($queryArray);
114121
} else {
115122
$query = '';
116123
}
124+
117125
return [$baseUrl, $query];
118126
}
119127
}

0 commit comments

Comments
 (0)