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();