mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Merge pull request #130 from adia/patch-1
validateUrlActive(): check host part of URL for correct DNS records
This commit is contained in:
commit
12edc5ab0b
@ -452,9 +452,9 @@ class Validator
|
||||
{
|
||||
foreach ($this->validUrlPrefixes as $prefix) {
|
||||
if (strpos($value, $prefix) !== false) {
|
||||
$url = str_replace($prefix, '', strtolower($value));
|
||||
|
||||
return checkdnsrr($url);
|
||||
$host = parse_url(strtolower($value), PHP_URL_HOST);
|
||||
|
||||
return checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA') || checkdnsrr($host, 'CNAME');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user