From 5a417480a142dd6068147d3b8bdb9153b52e9775 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 21 Oct 2016 17:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E9=AA=8C=E8=AF=81=E7=B1=BB?= =?UTF-8?q?=E7=9A=84activeUrl=E6=96=B9=E6=B3=95=20=E6=94=B9=E8=BF=9BQuery?= =?UTF-8?q?=E7=B1=BB=E5=88=86=E9=A1=B5=E6=96=B9=E6=B3=95=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Validate.php | 3 +++ library/think/db/Query.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/library/think/Validate.php b/library/think/Validate.php index d40a0f63..f16fee1b 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -612,6 +612,9 @@ class Validate */ protected function activeUrl($value, $rule) { + if (!in_array($rule, ['A', 'MX', 'NS', 'SOA', 'PTR', 'CNAME', 'AAAA', 'A6', 'SRV', 'NAPTR', 'TXT', 'ANY'])) { + $rule = 'MX'; + } return checkdnsrr($value, $rule); } diff --git a/library/think/db/Query.php b/library/think/db/Query.php index 52b0d18c..8a8617ff 100644 --- a/library/think/db/Query.php +++ b/library/think/db/Query.php @@ -989,8 +989,8 @@ class Query if (!isset($total) && !$simple) { $options = $this->getOptions(); - $total = $this->count(); $bind = $this->bind; + $total = $this->count(); $results = $this->options($options)->bind($bind)->page($page, $listRows)->select(); } elseif ($simple) { $results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select();