summaryrefslogtreecommitdiffstats
path: root/lib/private/Memcache
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-12 14:15:12 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-17 09:51:31 +0100
commit4ef302c0be2047f78b1aa3976eba003a2c280f64 (patch)
tree51b5c301126eebc6d6db91095e8cc7f2166b3324 /lib/private/Memcache
parent22b3280ac2b60e52049a07ada007768e3cef05ed (diff)
downloadnextcloud-server-4ef302c0be2047f78b1aa3976eba003a2c280f64.tar.gz
nextcloud-server-4ef302c0be2047f78b1aa3976eba003a2c280f64.zip
Request->getHeader() should always return a string
PHPDoc (of the public API) says that this method returns string but it also returns null, which is not allowed in some method calls. This fixes that behaviour and returns an empty string and fixes all code paths that explicitly checked for null to be still compliant. Found while enabling the strict_typing for lib/private for the PHP7+ migration. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Memcache')
-rw-r--r--lib/private/Memcache/APCu.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Memcache/APCu.php b/lib/private/Memcache/APCu.php
index 70f0d73d2d4..3e96acdecb7 100644
--- a/lib/private/Memcache/APCu.php
+++ b/lib/private/Memcache/APCu.php
@@ -158,8 +158,8 @@ class APCu extends Cache implements IMemcache {
} elseif (!\OC::$server->getIniWrapper()->getBool('apc.enable_cli') && \OC::$CLI) {
return false;
} elseif (
- version_compare(phpversion('apc'), '4.0.6') === -1 &&
- version_compare(phpversion('apcu'), '5.1.0') === -1
+ version_compare(phpversion('apc') ?: '0.0.0', '4.0.6') === -1 &&
+ version_compare(phpversion('apcu') ?: '0.0.0', '5.1.0') === -1
) {
return false;
} else {