summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-05-15 14:33:27 +0200
committerJoas Schilling <coding@schilljs.com>2017-05-15 14:33:27 +0200
commit72c1b248442fb05ef2ef1e8fbf3399cb06188013 (patch)
tree49887a496537c7c3a673d4f7319b04721fae517a /lib/base.php
parentc56c98183d2c8078c436e9b2e0c4f2a0031b4729 (diff)
downloadnextcloud-server-72c1b248442fb05ef2ef1e8fbf3399cb06188013.tar.gz
nextcloud-server-72c1b248442fb05ef2ef1e8fbf3399cb06188013.zip
Check whether the $_SERVER['REQUEST_*'] vars exist before using them
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index 483cd656916..bddd6a92cc8 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -132,7 +132,7 @@ class OC {
OC::$SUBURI = str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT)));
/**
- * FIXME: The following lines are required because we can't yet instantiiate
+ * FIXME: The following lines are required because we can't yet instantiate
* \OC::$server->getRequest() since \OC::$server does not yet exist.
*/
$params = [
@@ -174,7 +174,7 @@ class OC {
// Resolve /nextcloud to /nextcloud/ to ensure to always have a trailing
// slash which is required by URL generation.
- if($_SERVER['REQUEST_URI'] === \OC::$WEBROOT &&
+ if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI'] === \OC::$WEBROOT &&
substr($_SERVER['REQUEST_URI'], -1) !== '/') {
header('Location: '.\OC::$WEBROOT.'/');
exit();
@@ -1005,7 +1005,7 @@ class OC {
}
// Handle WebDAV
- if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
+ if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PROPFIND') {
// not allowed any more to prevent people
// mounting this root directly.
// Users need to mount remote.php/webdav instead.