From 4d9af08f12e6e5188bdee3f3860d5db473a86a16 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 2 Dec 2015 11:49:33 +0100 Subject: [PATCH] Execute only for web and not for CLI --- lib/base.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/base.php b/lib/base.php index 8c68b887a0..ed397d6a0e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -167,14 +167,14 @@ class OC { // a web URL, so we use overwritewebroot as a fallback. OC::$WEBROOT = OC_Config::getValue('overwritewebroot', ''); } - } - // 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(); + // 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