diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-07-12 13:15:20 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2021-07-12 13:15:20 +0200 |
commit | b0cef8827daf5e21e8c02ec871b34ad73459db01 (patch) | |
tree | 20b39e215793a95f01bc3ad61fc53a7f792d54ae /lib/private/Http/Client/DnsPinMiddleware.php | |
parent | a8aeaa6c7be0b016df93a8893eb8d6d029fd01bc (diff) | |
download | nextcloud-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.php | 2 |
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']; |