aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Http/Client/DnsPinMiddleware.php
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2021-07-12 13:15:20 +0200
committerLukas Reschke <lukas@statuscode.ch>2021-07-12 13:15:20 +0200
commitb0cef8827daf5e21e8c02ec871b34ad73459db01 (patch)
tree20b39e215793a95f01bc3ad61fc53a7f792d54ae /lib/private/Http/Client/DnsPinMiddleware.php
parenta8aeaa6c7be0b016df93a8893eb8d6d029fd01bc (diff)
downloadnextcloud-server-b0cef8827daf5e21e8c02ec871b34ad73459db01.tar.gz
nextcloud-server-b0cef8827daf5e21e8c02ec871b34ad73459db01.zip
Check if dns_get_record returns non-false
`dns_get_record` can return false which results in exceptions such as the ones shown in https://github.com/nextcloud/server/issues/27870. Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/Http/Client/DnsPinMiddleware.php')
-rw-r--r--lib/private/Http/Client/DnsPinMiddleware.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Http/Client/DnsPinMiddleware.php b/lib/private/Http/Client/DnsPinMiddleware.php
index 9e5cfc919f1..6b5437fa66a 100644
--- a/lib/private/Http/Client/DnsPinMiddleware.php
+++ b/lib/private/Http/Client/DnsPinMiddleware.php
@@ -82,7 +82,7 @@ class DnsPinMiddleware {
$dnsResponses = dns_get_record($target, $dnsType);
$canHaveCnameRecord = true;
- if (count($dnsResponses) > 0) {
+ if ($dnsResponses && count($dnsResponses) > 0) {
foreach ($dnsResponses as $dnsResponse) {
if (isset($dnsResponse['ip'])) {
$targetIps[] = $dnsResponse['ip'];