-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Ignore subdomain for soa queries #27801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| $dnsResponses = dns_get_record($target, $dnsType); | ||
| $canHaveCnameRecord = true; | ||
| if (count($dnsResponses) > 0) { | ||
| foreach ($dnsResponses as $key => $dnsResponse) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code cleanup: As $key is unused and may overwrite $key from the outer loop.
| foreach ($dnsTypes as $key => $dnsType) { | ||
| foreach ($dnsTypes as $dnsType) { | ||
| if ($this->negativeDnsCache->isNegativeCached($target, $dnsType)) { | ||
| unset($dnsTypes[$key]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As $dnsTypes is not used it's fine to not unset the value and just continue.
| $second = array_pop($labels); | ||
|
|
||
| $hostname = $second . '.' . $top; | ||
| return dns_get_record($hostname, DNS_SOA); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ host -t SOA www.nextcloud.com
www.nextcloud.com has no SOA record
$ host -t SOA nextcloud.com
nextcloud.com has SOA record ns.inwx.de. hostmaster.inwx.de. 2021033001 10800 3600 604800 3600
|
phpcs is complaining |
|
/backport to stable22 |
a513014 to
1903ced
Compare
| $dnsNegativeTtl = null; | ||
| } | ||
| $soaDnsEntry = $this->soaRecord($target); | ||
| $dnsNegativeTtl = $soaDnsEntry[0]['minimum-ttl'] ?? null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the php doc $soaDnsEntry can be false. Perhaps you can turn false to null and add it as return type hint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Daniel Kesselberg <[email protected]>
b24e105 to
b6530e5
Compare
No description provided.