summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-31 22:03:55 +0100
committerLukas Reschke <lukas@statuscode.ch>2012-10-31 22:03:55 +0100
commit81f019b6c5aea827b72dc2aef115e4f0a5cf48c1 (patch)
tree85e233af1efe57d5143fc587fc31d2edabde9ccf /lib
parent3813ee78c3ca89b46834dcce7d69b22bb1f4bbdb (diff)
downloadnextcloud-server-81f019b6c5aea827b72dc2aef115e4f0a5cf48c1.tar.gz
nextcloud-server-81f019b6c5aea827b72dc2aef115e4f0a5cf48c1.zip
Make the redirect_url working again
Fixes #160
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php2
-rwxr-xr-xlib/util.php10
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/base.php b/lib/base.php
index 5c3d3fb80ce..eee36da2eb2 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -656,7 +656,7 @@ class OC{
else {
OC_User::unsetMagicInCookie();
}
- header( 'Location: '.$_SERVER['REQUEST_URI'] );
+ OC_Util::redirectToDefaultPage();
exit();
}
return true;
diff --git a/lib/util.php b/lib/util.php
index de89e339d99..622a42982c3 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -340,10 +340,8 @@ class OC_Util {
}
if (isset($_REQUEST['redirect_url'])) {
$redirect_url = OC_Util::sanitizeHTML($_REQUEST['redirect_url']);
- } else {
- $redirect_url = $_SERVER['REQUEST_URI'];
- }
- $parameters['redirect_url'] = $redirect_url;
+ }
+ $parameters['redirect_url'] = urlencode($redirect_url);
OC_Template::printGuestPage("", "login", $parameters);
}
@@ -439,8 +437,8 @@ class OC_Util {
* Redirect to the user default page
*/
public static function redirectToDefaultPage() {
- if(isset($_REQUEST['redirect_url']) && (substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT || $_REQUEST['redirect_url'][0] == '/')) {
- $location = $_REQUEST['redirect_url'];
+ if(isset($_REQUEST['redirect_url'])) {
+ $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
}
else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
$location = OC_Helper::linkToAbsolute( OC::$REQUESTEDAPP, 'index.php' );