1
0
mirror of https://github.com/danog/dns.git synced 2024-11-26 20:14:51 +01:00

Add (array) cast for $types inside resolve()

This commit is contained in:
Bob Weinand 2016-03-24 20:17:04 +01:00
parent 4311c836bf
commit 78cda5692a

View File

@ -64,7 +64,7 @@ class DefaultResolver implements Resolver {
public function resolve($name, array $options = []) {
if (!$inAddr = @\inet_pton($name)) {
if ($this->isValidHostName($name)) {
$types = empty($options["types"]) ? [Record::A, Record::AAAA] : $options["types"];
$types = empty($options["types"]) ? [Record::A, Record::AAAA] : (array) $options["types"];
return $this->pipeResult($this->recurseWithHosts($name, $types, $options), $types);
} else {
return new Failure(new ResolutionException("Cannot resolve; invalid host name"));