From e2ca9339d708b9f539a7dc768113122ee716b4da Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 26 Mar 2016 12:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BactiveUrl=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=94=AF=E6=8C=81=E5=B8=A6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/library/think/Validate.php b/library/think/Validate.php index fd264b99..eeb92eec 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -507,6 +507,18 @@ class Validate return $result; } + /** + * 验证是否为合格的域名或者IP 支持A,MX,NS,SOA,PTR,CNAME,AAAA,A6, SRV,NAPTR,TXT 或者 ANY类型 + * @access protected + * @param mixed $value 字段值 + * @param mixed $rule 验证规则 + * @return bool + */ + protected function activeUrl($value, $rule) + { + return checkdnsrr($value, $rule); + } + /** * 验证时间和日期是否符合指定格式 * @access protected