summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-07-16 16:40:57 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-07-17 12:35:00 +0200
commitfc6420c2905b63017d3ea23eee8a542987d5b286 (patch)
treea36f0b210667ea722b7df931fca620aef24c4645 /lib
parent015d4e3ba373ff3bb60abb036ef3e53731f33799 (diff)
downloadnextcloud-server-fc6420c2905b63017d3ea23eee8a542987d5b286.tar.gz
nextcloud-server-fc6420c2905b63017d3ea23eee8a542987d5b286.zip
Fixing 'Undefined index: REMOTE_ADDR' - fixes #17460
Diffstat (limited to 'lib')
-rw-r--r--lib/private/appframework/http/request.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/appframework/http/request.php b/lib/private/appframework/http/request.php
index 7d6a49202c6..d3ebcfc6925 100644
--- a/lib/private/appframework/http/request.php
+++ b/lib/private/appframework/http/request.php
@@ -478,7 +478,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
*/
private function isOverwriteCondition($type = '') {
$regex = '/' . $this->config->getSystemValue('overwritecondaddr', '') . '/';
- return $regex === '//' || preg_match($regex, $this->server['REMOTE_ADDR']) === 1
+ $remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : '';
+ return $regex === '//' || preg_match($regex, $remoteAddr) === 1
|| $type !== 'protocol';
}