summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2020-07-11 08:36:13 +0800
committerBigCoke233 <hi@guhub.cn>2020-07-11 08:36:13 +0800
commitb0d993e2a2244cc392c89bd9d4971151dab6e9b4 (patch)
tree2c3690ba00e62096fb46c385ec17d30adc3f75d5 /libs
parented54b109c4d95bf3f8f3f481ee884e835018efa6 (diff)
:bug: Fix: 修复评论区无法使用
Diffstat (limited to 'libs')
-rw-r--r--libs/Comments.php4
-rw-r--r--libs/Utils.php2
2 files changed, 3 insertions, 3 deletions
diff --git a/libs/Comments.php b/libs/Comments.php
index 78fd087..d97b4bc 100644
--- a/libs/Comments.php
+++ b/libs/Comments.php
@@ -15,9 +15,9 @@ class Comments
*
* @access public
*/
- public static function AntiSpam($comment) {
+ public static function AntiSpam($id, $value) {
if ($comment->options->switch && in_array('html', $comment->options->switch)) { echo '<!--<nocompress>-->'; }
- echo '<script>(function(){var a=document.addEventListener?{add:"addEventListener",focus:"focus",load:"DOMContentLoaded"}:{add:"attachEvent",focus:"onfocus",load:"onload"};var c,d,e,f,b=document.getElementById("'.$comment->respondId.'");null!=b&&(c=b.getElementsByTagName("form"),c.length>0&&(d=c[0],e=d.getElementsByTagName("textarea")[0],f=!1,null!=e&&"text"==e.name&&e[a.add](a.focus,function(){if(!f){var a=document.createElement("input");a.type="hidden",a.name="_",d.appendChild(a),f=!0,a.value='.Typecho_Common::shuffleScriptVar($comment->security->getToken($comment->request->getRequestUrl())).'}})))})();</script>';
+ echo '<script>(function(){var a=document.addEventListener?{add:"addEventListener",focus:"focus",load:"DOMContentLoaded"}:{add:"attachEvent",focus:"onfocus",load:"onload"};var c,d,e,f,b=document.getElementById("'.$id.'");null!=b&&(c=b.getElementsByTagName("form"),c.length>0&&(d=c[0],e=d.getElementsByTagName("textarea")[0],f=!1,null!=e&&"text"==e.name&&e[a.add](a.focus,function(){if(!f){var a=document.createElement("input");a.type="hidden",a.name="_",d.appendChild(a),f=!0,a.value='.$value.'}})))})();</script>';
if ($comment->options->switch && in_array('html', $comment->options->switch)) { echo '<!--</nocompress>-->'; }
}
diff --git a/libs/Utils.php b/libs/Utils.php
index 69ebe60..f9785bc 100644
--- a/libs/Utils.php
+++ b/libs/Utils.php
@@ -113,7 +113,7 @@ class Utils
/**
* 自动生成引用
*/
- function addRequires($files,$type,$cdn,$custom) {
+ public static function addRequires($files,$type,$cdn,$custom) {
if ($cdn=='1'){
$path = 'https://cdn.jsdelivr.net/gh/BigCoke233/miracles@'.themeVersion()."/assets/";
}