mirror of
https://github.com/typecho/typecho.git
synced 2025-03-18 17:09:41 +01:00
fix stack
This commit is contained in:
parent
3d0b5d5f6c
commit
4b97110087
@ -239,12 +239,12 @@ class Typecho_Validate
|
||||
* @access public
|
||||
*
|
||||
* @param string $key 数值键值
|
||||
* @param string $rule 规则名称
|
||||
* @param string|array $rule 规则名称
|
||||
* @param string $message 错误字符串
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addRule(string $key, string $rule, string $message): Typecho_Validate
|
||||
public function addRule(string $key, $rule, string $message): Typecho_Validate
|
||||
{
|
||||
if (func_num_args() <= 3) {
|
||||
$this->_rules[$key][] = [$rule, $message];
|
||||
|
@ -255,10 +255,14 @@ abstract class Typecho_Widget
|
||||
*/
|
||||
public function next()
|
||||
{
|
||||
if ($this->sequence < count($this->stack)) {
|
||||
$this->row = $this->stack[$this->sequence];
|
||||
$key = key($this->stack);
|
||||
|
||||
if ($key !== null && isset($this->stack[$key])) {
|
||||
$this->row = current($this->stack);
|
||||
next($this->stack);
|
||||
$this->sequence ++;
|
||||
} else {
|
||||
reset($this->stack);
|
||||
$this->sequence = 0;
|
||||
return false;
|
||||
}
|
||||
|
@ -70,14 +70,11 @@ class Widget_Comments_Archive extends Widget_Abstract_Comments
|
||||
/**
|
||||
* 输出文章评论数
|
||||
*
|
||||
* @access public
|
||||
* @param string $string 评论数格式化数据
|
||||
* @return void
|
||||
* @param ...$args
|
||||
*/
|
||||
public function num()
|
||||
public function num(...$args)
|
||||
{
|
||||
$args = func_get_args();
|
||||
if (!$args) {
|
||||
if (empty($args)) {
|
||||
$args[] = '%d';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user