mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-31 07:01:54 +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) {
|
foreach ($this->validUrlPrefixes as $prefix) {
|
||||||
if (strpos($value, $prefix) !== false) {
|
if (strpos($value, $prefix) !== false) {
|
||||||
$url = str_replace($prefix, '', strtolower($value));
|
$host = parse_url(strtolower($value), PHP_URL_HOST);
|
||||||
|
|
||||||
return checkdnsrr($url);
|
return checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA') || checkdnsrr($host, 'CNAME');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user