增加文件回复规则

This commit is contained in:
Anyon 2020-12-12 14:25:42 +08:00
parent 0c340143ca
commit cedba012b9

View File

@ -196,8 +196,8 @@ class Push extends Controller
*/ */
private function _keys(string $rule, bool $last = false, bool $custom = false) private function _keys(string $rule, bool $last = false, bool $custom = false)
{ {
if (stripos($rule, 'WechatKeys#keys#reply#text:') === 0) { if (is_numeric(stripos($rule, '#reply#text:'))) {
[, $content] = explode('WechatKeys#keys#reply#text:', $rule); [, $content] = explode('#reply#text:', $rule);
return $this->_buildMessage('text', ['Content' => $content]); return $this->_buildMessage('text', ['Content' => $content]);
} }
[$table, $field, $value] = explode('#', $rule . '##'); [$table, $field, $value] = explode('#', $rule . '##');
@ -323,7 +323,7 @@ class Push extends Controller
* @param array $data * @param array $data
* @return array * @return array
*/ */
private function _arrayChangeKeyCase(array $data) private function _arrayChangeKeyCase(array $data): array
{ {
$data = array_change_key_case($data, CASE_LOWER); $data = array_change_key_case($data, CASE_LOWER);
foreach ($data as $key => $vo) if (is_array($vo)) { foreach ($data as $key => $vo) if (is_array($vo)) {