From 7623eacfe56daeaa53ee027f20831bad06406356 Mon Sep 17 00:00:00 2001 From: Lufei Date: Fri, 23 Dec 2022 11:24:46 +0800 Subject: [PATCH] * Fix feishu webhook missing msg_type when no secret. --- module/webhook/model.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/webhook/model.php b/module/webhook/model.php index 74a292e885..8999a62d6f 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -453,7 +453,7 @@ class webhookModel extends model { $data = $this->getWeixinData($title, $text, $mobile); } - elseif($webhook->type == 'feishuuser') + elseif($webhook->type == 'feishuuser' or $webhook->type == 'feishugroup') { $data = $this->getFeishuData($title, $text); } @@ -705,11 +705,9 @@ class webhookModel extends model $sign = $timestamp . "\n" . $webhook->secret; $sign = base64_encode(hash_hmac('sha256', '', $sign, true)); - $content = array(); - $content['timestamp'] = $timestamp; - $content['sign'] = $sign; - $content['msg_type'] = 'text'; - $content['content'] = json_decode($sendData); + $content = json_decode($sendData); + $content->timestamp = $timestamp; + $content->sign = $sign; $sendData = json_encode($content); }