fix: generate correct referring urls and code cleanup

This commit is contained in:
Björn Fromme
2024-10-24 10:58:03 +02:00
parent a70110df45
commit 5de929aa55
5 changed files with 4 additions and 8 deletions
@@ -92,7 +92,8 @@ class ProductViewHelper extends AbstractViewHelper
if ($arguments['ref']) {
$referringPageUri = urlencode($arguments['ref']);
$separator = false !== strpos($uri, '?') ? '&' : '?';
$hasQuery = null !== parse_url($uri, PHP_URL_QUERY);
$separator = $hasQuery ? '&' : '?';
$uri .= $separator . 'ref=' . $referringPageUri;
}