Skip to content

Commit

Permalink
SANTA-231 don't add if already present
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Cannaerts committed Nov 22, 2024
1 parent 8171625 commit f5bb890
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Service/UrlTransformerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ public function transformUrl(string $url): string
case 'amazon_' == substr($key, 0, 7):
// append id as tag parameter
if (isset($urlParts['query'])) {
$url .= '&tag='.$partnerId;
// don't touch if there's already a tag present
if (false === strpos($urlParts['query'], '&tag=') && 'tag=' !== substr($urlParts['query'], 0, 4)) {
$url .= '&tag='.$partnerId;
}
} else {
$url .= '?tag='.$partnerId;
}
Expand Down

0 comments on commit f5bb890

Please sign in to comment.