summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/base.php b/lib/base.php
index 6a1841fa93b..8c68b887a05 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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);