From 743849c3ed9fb5984f908dad758a35392712e555 Mon Sep 17 00:00:00 2001 From: haemmer Date: Wed, 13 Jun 2012 11:38:09 +0000 Subject: [PATCH] Fixed #1812 --- templates.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/templates.php b/templates.php index 6fc839b..7606ef3 100755 --- a/templates.php +++ b/templates.php @@ -334,8 +334,8 @@ function submitForm(){ if (entityIDGETParam != "" && returnGETParam != ""){ redirect_url = returnGETParam; } else { - redirect_url = wayf_sp_samlDSURL ; - redirect_url += '?target=' + encodeURIComponent(wayf_return_url); + redirect_url = wayf_sp_samlDSURL; + redirect_url += getGETArgumentSeparator(redirect_url) + 'target=' + encodeURIComponent(wayf_return_url); } // Append selected Identity Provider @@ -712,6 +712,14 @@ function getGETArgument(name){ } } +function getGETArgumentSeparator(url){ + if (url.indexOf('?') >=0 ){ + return '&'; + } else { + return '?'; + } +} + (function() { var config_ok = true; @@ -1016,7 +1024,8 @@ function getGETArgument(name){ wayf_authReq_URL += '?entityID=' + encodeURIComponent(entityIDGETParam); wayf_authReq_URL += '&return=' + encodeURIComponent(returnGETParam); } else { - var return_url = wayf_sp_samlDSURL + '?SAMLDS=1&target=' + encodeURIComponent(wayf_return_url); + var return_url = wayf_sp_samlDSURL + getGETArgumentSeparator(wayf_sp_samlDSURL); + return_url += 'SAMLDS=1&target=' + encodeURIComponent(wayf_return_url); wayf_authReq_URL += '?entityID=' + encodeURIComponent(wayf_sp_entityID); wayf_authReq_URL += '&return=' + encodeURIComponent(return_url); } -- GitLab