Skip to content
Snippets Groups Projects
Commit ba5d3a24 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Änderung von URL-Parametern nun möglich

Bislang konnten nicht mehrere GET-Request hintereinander auf die gleiche URL, aber mit anderen Parametern gestartet werden. Dies ist nun möglich. Die vorhandenen paramter werden nun geupdated
parent 8d1f78ee
No related branches found
No related tags found
No related merge requests found
...@@ -33,11 +33,26 @@ class ProxyController extends Controller ...@@ -33,11 +33,26 @@ class ProxyController extends Controller
# Let's redirect to the correct URI # Let's redirect to the correct URI
$proxyParams = $request->except(array_keys($params)); $proxyParams = $request->except(array_keys($params));
$redirProxyUrl = $targetUrl; $redirProxyUrl = $targetUrl;
$redirParams = [];
if (strpos($redirProxyUrl, "?") === false) { if (strpos($redirProxyUrl, "?") === false) {
$redirProxyUrl .= "?"; $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) { foreach ($params as $key => $value) {
$redirParams[$key] = $value;
}
foreach ($redirParams as $key => $value) {
$redirProxyUrl .= $key . "=" . urlencode($value) . "&"; $redirProxyUrl .= $key . "=" . urlencode($value) . "&";
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment