Skip to content

Commit c29ccc5

Browse files
committed
Treat false return value from dns_get_record
1 parent ee3481e commit c29ccc5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ public function validateActiveUrl($attribute, $value)
117117

118118
if ($url = parse_url($value, PHP_URL_HOST)) {
119119
try {
120-
return count($this->dnsRecords($url.'.', DNS_A | DNS_AAAA)) > 0;
120+
$records = $this->dnsRecords($url.'.', DNS_A | DNS_AAAA);
121+
if (is_array($records) && count($records) > 0) {
122+
return true;
123+
}
121124
} catch (Exception $e) {
122125
return false;
123126
}

0 commit comments

Comments
 (0)