Files
plugins/CommentPush/Action.php
chorblack e75f275ef4
Some checks failed
定时更新GitHub源插件 / 自动更新GitHub插件 (push) Has been cancelled
Initial commit
2026-03-07 11:19:25 +08:00

36 lines
861 B
PHP

<?php
/**
* @author gaobinzhan <gaobinzhan@gmail.com>
* @link https://blog.gaobinzhan.com
*/
class CommentPush_Action extends Typecho_Widget implements Widget_Interface_Do
{
public function action()
{
// TODO: Implement action() method.
}
public static function officialAccount()
{
$options = Helper::options();
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$echostr = $_GET["echostr"];
$token = $options->plugin('CommentPush')->officialAccountToken;
$tmpArr = array($token, $timestamp, $nonce);
sort($tmpArr, SORT_STRING);
$tmpStr = implode($tmpArr);
$tmpStr = sha1($tmpStr);
if ($tmpStr == $signature) {
echo $echostr;
} else {
echo false;
}
}
}