summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/request.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/request.php b/lib/private/request.php
index 3bf7d94d9cf..73755e226c4 100644
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -61,7 +61,8 @@ class OC_Request {
*/
private static function isOverwriteCondition($type = '') {
$regex = '/' . OC_Config::getValue('overwritecondaddr', '') . '/';
- return $regex === '//' or preg_match($regex, $_SERVER['REMOTE_ADDR']) === 1
+ $remoteAddress = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
+ return $regex === '//' or preg_match($regex, $remoteAddress) === 1
or ($type !== 'protocol' and OC_Config::getValue('forcessl', false));
}