diff --git a/app/Http/Controllers/ProxyController.php b/app/Http/Controllers/ProxyController.php index 07616a4e185f14457d9efc06c94c584886cb9fea..fb4ea0413e66ff6601f5003bec989bb0a9b8c52b 100644 --- a/app/Http/Controllers/ProxyController.php +++ b/app/Http/Controllers/ProxyController.php @@ -33,11 +33,26 @@ class ProxyController extends Controller # Let's redirect to the correct URI $proxyParams = $request->except(array_keys($params)); $redirProxyUrl = $targetUrl; + $redirParams = []; if (strpos($redirProxyUrl, "?") === false) { $redirProxyUrl .= "?"; + } else { + # There are already Params for this site which need to get updated + $tmpParams = substr($redirProxyUrl, strpos($redirProxyUrl, "?") + 1); + $tmpParams = explode("&", $tmpParams); + foreach ($tmpParams as $param) { + $tmp = explode("=", $param); + if (sizeof($tmp) === 2) { + $redirParams[$tmp[0]] = $tmp[1]; + } + } } foreach ($params as $key => $value) { + $redirParams[$key] = $value; + } + + foreach ($redirParams as $key => $value) { $redirProxyUrl .= $key . "=" . urlencode($value) . "&"; }