Skip to content
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

Constructor DNSRecords may be passed a bool as first argument #356

Open
fmarchalemisys opened this issue Jan 12, 2023 · 0 comments
Open

Comments

@fmarchalemisys
Copy link

The constructor of DNSRecords expects an array as first argument.

public function __construct(array $records, bool $error = false)

But it is created in DNSGetRecordWrapper with the result returned by dns_get_record().

return new DNSRecords(dns_get_record($host, $type));

According to the documentation, dns_get_record() may return false in case of error. Querying an invalid or unknown domain results in false being returned. Passing false when an array type is expected produces a fatal crash.

I suspect that if dns_get_result() returns false, it must be replaced with the empty array [].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant