Merge pull request #20889 from owncloud/fix-logout-for-bjoern

Ensure trailing slash in URIs
This commit is contained in:
Lukas Reschke 2015-12-02 11:41:00 +01:00
commit 361093fb7b
2 changed files with 9 additions and 1 deletions

View File

@ -169,6 +169,14 @@ class OC {
}
}
// Resolve /owncloud to /owncloud/ to ensure to always have a trailing
// slash which is required by URL generation.
if($_SERVER['REQUEST_URI'] === \OC::$WEBROOT &&
substr($_SERVER['REQUEST_URI'], -1) !== '/') {
header('Location: '.\OC::$WEBROOT.'/');
exit();
}
// search the 3rdparty folder
OC::$THIRDPARTYROOT = OC_Config::getValue('3rdpartyroot', null);
OC::$THIRDPARTYWEBROOT = OC_Config::getValue('3rdpartyurl', null);

View File

@ -114,7 +114,7 @@ class URLGenerator implements IURLGenerator {
$urlLinkTo = \OC::$WEBROOT . '/core/' . $file;
} else {
if ($frontControllerActive && $file === 'index.php') {
$urlLinkTo = \OC::$WEBROOT;
$urlLinkTo = \OC::$WEBROOT . '/';
} else {
$urlLinkTo = \OC::$WEBROOT . '/' . $file;
}