Skip to content
Snippets Groups Projects
Commit 361093fb authored by Lukas Reschke's avatar Lukas Reschke
Browse files

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

Ensure trailing slash in URIs
parents d4abbb10 09d9e430
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment