From e72e723c1e399b5dce7212a14bc4b506a0a4eab1 Mon Sep 17 00:00:00 2001 From: dawnlight Date: Mon, 23 Jul 2018 10:40:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A0=86=E6=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在没有评论且开启评论分页的情况下,$this->row 会被错误地赋值为 false,在之后通过魔术方法 __get 获取内部变量时会抛出警告 Warning: array_key_exists() expects parameter 2 to be array, boolean given --- var/Widget/Comments/Archive.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/var/Widget/Comments/Archive.php b/var/Widget/Comments/Archive.php index 9ada6579..14844f70 100644 --- a/var/Widget/Comments/Archive.php +++ b/var/Widget/Comments/Archive.php @@ -282,7 +282,8 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments ($this->_currentPage - 1) * $this->options->commentsPageSize, $this->options->commentsPageSize); /** 评论置位 */ - $this->row = current($this->stack); + if ($this->_total !== 0) + $this->row = current($this->stack); $this->length = count($this->stack); }