记 Typecho 插件 Comment2Mail 报错的修复

Typecho 更新后,邮箱通知插件 Comment2Mail 在回复时会报错并无法送信。

报错信息如下:

Argument 1 passed to Typecho\Widget::__construct() must be an instance of Typecho\Widget\Request, instance of Typecho\Request given, called in */usr/plugins/Comment2Mail/Plugin.php on line 173

经过查询,在 Typecho 的 GitHub Issue 中已有人提问过,joyqi 给出的修复方案如下:

修改 usr/plugins/Comment2Mail/Plugin.php:根据报错信息提供的行数(上文所述的报错信息line 173,所以行数是 173 ),将原代码

$widget = new Widget_Abstract_Comments(new Typecho_Request(), new Typecho_Response());

修改为

$widget = Widget_Base_Comments::alloc();

即可。

添加新评论