]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use URLGenerator instead of hard-coded WEBROOT
authorLukas Reschke <lukas@owncloud.com>
Thu, 3 Dec 2015 13:42:14 +0000 (14:42 +0100)
committerLukas Reschke <lukas@owncloud.com>
Thu, 3 Dec 2015 13:42:14 +0000 (14:42 +0100)
Fixes https://github.com/owncloud/core/issues/20922

lib/base.php

index ed397d6a0e8d84bec9df74f7ffd4e55e617f253f..038c259ecf604a219115dbcd7fa127e286116923 100644 (file)
@@ -898,7 +898,7 @@ class OC {
                // 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
                if(isset($_GET['logout']) && !OC_User::isLoggedIn()) {
-                       header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : ''));
+                       header("Location: " . \OC::$server->getURLGenerator()->getAbsoluteURL('/'));
                        return;
                }
 
@@ -914,7 +914,7 @@ class OC {
                                }
                                OC_User::logout();
                                // redirect to webroot and add slash if webroot is empty
-                               header("Location: " . OC::$WEBROOT.(empty(OC::$WEBROOT) ? '/' : ''));
+                               header("Location: " . \OC::$server->getURLGenerator()->getAbsoluteURL('/'));
                        } else {
                                // Redirect to default application
                                OC_Util::redirectToDefaultPage();