|
...
|
...
|
@@ -310,15 +310,19 @@ class SyncSubmitTaskService |
|
|
|
//过滤内容
|
|
|
|
if(!empty($data['data']['message'])) {
|
|
|
|
//过滤内容关键字
|
|
|
|
if (!empty($config['filter_contents'])){
|
|
|
|
if (!empty($config['filter_contents'])) {
|
|
|
|
foreach ($config['filter_contents'] as $filter_content) {
|
|
|
|
//要指定词才过滤
|
|
|
|
if (preg_match("/\b" . preg_quote($filter_content, "/") . "\b/i", $data['data']['message'])) {
|
|
|
|
throw new InquiryFilterException('过滤内容:' . $filter_content);
|
|
|
|
//中文直接包含
|
|
|
|
if (preg_match("/^[\x{4e00}-\x{9fa5}]+$/u", $filter_content)) {
|
|
|
|
if (Str::contains($data['data']['message'], $filter_content)) {
|
|
|
|
throw new InquiryFilterException('过滤内容:' . $filter_content);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//英文要指定词才过滤
|
|
|
|
if (preg_match("/\b" . preg_quote($filter_content, "/") . "\b/i", $data['data']['message'])) {
|
|
|
|
throw new InquiryFilterException('过滤内容:' . $filter_content);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// if (Str::contains(strtolower($data['data']['message']), strtolower($filter_content))) {
|
|
|
|
// throw new InquiryFilterException('过滤内容:' . $filter_content);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|