diff --git a/core/lib/Thelia/Tools/URL.php b/core/lib/Thelia/Tools/URL.php index 05084c0c1..650cb9de1 100755 --- a/core/lib/Thelia/Tools/URL.php +++ b/core/lib/Thelia/Tools/URL.php @@ -140,8 +140,14 @@ class URL if (! is_null($parameters)) { foreach ($parameters as $name => $value) { + + // Remove this parameter from base URL to prevent duplicate parameters + $base = preg_replace('/([?&])'.$name.'=([^&])*(&|$)/', '$1', $base); + $queryString .= sprintf("%s=%s&", urlencode($name), urlencode($value)); } + + $base = rtrim($base, '&'); } $sepChar = strstr($base, '?') === false ? '?' : '&';