aboutsummaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-12-02 11:26:41 +0100
committerLukas Reschke <lukas@owncloud.com>2015-12-02 11:26:41 +0100
commit125b7e75121ee8b3ca35553f5c3365884557189f (patch)
treeac358d23a9d894670db068de206429ba003c50de /lib/base.php
parentd4abbb10d3b8b1b6685f239c8e6ec5e19d013680 (diff)
downloadnextcloud-server-125b7e75121ee8b3ca35553f5c3365884557189f.tar.gz
nextcloud-server-125b7e75121ee8b3ca35553f5c3365884557189f.zip
Ensure that ownCloud is always accessed with a trailing slash
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);