Skip to content

Commit

Permalink
Merge pull request #26551 from nextcloud/fix/noid/redis-exists-bool
Browse files Browse the repository at this point in the history
ensure redis returns bool for hasKey
  • Loading branch information
rullzer authored Apr 14, 2021
2 parents 644ce9e + 9f5480e commit f031dd6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/private/Http/Client/NegativeDnsCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public function setNegativeCacheForDnsType(string $domain, int $type, int $ttl)
}

public function isNegativeCached(string $domain, int $type) : bool {
return $this->cache->hasKey($this->createCacheKey($domain, $type));
return (bool)$this->cache->hasKey($this->createCacheKey($domain, $type));
}
}
2 changes: 1 addition & 1 deletion lib/private/Memcache/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function set($key, $value, $ttl = 0) {
}

public function hasKey($key) {
return self::$cache->exists($this->getNameSpace() . $key);
return (bool)self::$cache->exists($this->getNameSpace() . $key);
}

public function remove($key) {
Expand Down

0 comments on commit f031dd6

Please sign in to comment.