diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2021-07-12 13:15:20 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-07-12 14:46:42 +0000 |
commit | 525dfd2f4d30e0536e13718f8211826c8c99720d (patch) | |
tree | 3f4af60e77e25b6480606b815a8880cb8b288598 /lib/private | |
parent | 32f0d859573f62ca61028163b7f9ddc5b5644c9c (diff) | |
download | nextcloud-server-525dfd2f4d30e0536e13718f8211826c8c99720d.tar.gz nextcloud-server-525dfd2f4d30e0536e13718f8211826c8c99720d.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')
-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']; |