Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check if dns_get_record returns non-false
`dns_get_record` can return false which results in exceptions such as
the ones shown in #27870.

Signed-off-by: Lukas Reschke <[email protected]>
  • Loading branch information
LukasReschke committed Jul 12, 2021
commit b0cef8827daf5e21e8c02ec871b34ad73459db01
2 changes: 1 addition & 1 deletion lib/private/Http/Client/DnsPinMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function dnsResolve(string $target, int $recursionCount) : array {

$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'];
Expand Down