Merge pull request #20924 from owncloud/use-url-generator-to-generate-link

Use URLGenerator instead of hard-coded WEBROOT
This commit is contained in:
Thomas Müller 2015-12-03 15:26:14 +01:00
commit 1fe7957fd0
1 changed files with 2 additions and 2 deletions

View File

@ -898,7 +898,7 @@ class OC {
// this is needed to prevent "Token expired" messages while login if a session is expired // this is needed to prevent "Token expired" messages while login if a session is expired
// @see https://github.com/owncloud/core/pull/8443#issuecomment-42425583 // @see https://github.com/owncloud/core/pull/8443#issuecomment-42425583
if(isset($_GET['logout']) && !OC_User::isLoggedIn()) { if(isset($_GET['logout']) && !OC_User::isLoggedIn()) {
header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : '')); header("Location: " . \OC::$server->getURLGenerator()->getAbsoluteURL('/'));
return; return;
} }
@ -914,7 +914,7 @@ class OC {
} }
OC_User::logout(); OC_User::logout();
// redirect to webroot and add slash if webroot is empty // redirect to webroot and add slash if webroot is empty
header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : '')); header("Location: " . \OC::$server->getURLGenerator()->getAbsoluteURL('/'));
} else { } else {
// Redirect to default application // Redirect to default application
OC_Util::redirectToDefaultPage(); OC_Util::redirectToDefaultPage();