From: Jan Date: Fri, 28 May 2010 10:38:18 +0000 (+0100) Subject: Make sure that we have a return URL if using the alternate login screen. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=38677aa09d468fee0c369f90088237eb2d82a3bc;p=horde.git Make sure that we have a return URL if using the alternate login screen. --- diff --git a/horde/login.php b/horde/login.php index 535889293..20d70e749 100644 --- a/horde/login.php +++ b/horde/login.php @@ -254,13 +254,14 @@ if (!empty($conf['auth']['alternate_login'])) { if (!isset($_COOKIE[session_name()])) { $url = Horde_Util::addParameter($url, array(session_name() => session_id), null, false); } - if (!empty($url_in)) { - $anchor = _addAnchor($url_in, 'param', $url_anchor); - if (strpos($url, '%25u')) { - $url = str_replace('%25u', $anchor, $url); - } else { - $url = Horde_Util::addParameter($url, array('url' => $anchor), null, false); - } + if (empty($url_in)) { + $url_in = Horde::selfUrl(true, true, true); + } + $anchor = _addAnchor($url_in, 'param', $url_anchor); + if (strpos($url, '%25u') || strpos($url, '%u')) { + $url = str_replace(array('%25u', '%u'), $anchor, $url); + } else { + $url = Horde_Util::addParameter($url, array('url' => $anchor), null, false); } header('Location: ' . _addAnchor($url, 'url', $url_anchor)); exit;