From 49569036c5c8ca4c7dcef9802c8f71d5169cd5c0 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Wed, 8 May 2019 21:38:57 +0800 Subject: [PATCH] =?UTF-8?q?:beers:=20=E9=86=89=E9=85=92=E5=86=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/index/controller/Upload.php | 7 +++++-- config/site.php | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 config/site.php diff --git a/application/index/controller/Upload.php b/application/index/controller/Upload.php index 6464e3ba..33ba833d 100644 --- a/application/index/controller/Upload.php +++ b/application/index/controller/Upload.php @@ -107,8 +107,11 @@ class Upload extends Base $result = json_decode($response->getBody()->getContents()); if (0 == $result->error_code) { if ($result->rating_index >= $this->config['audit_index']) { - /*$strategy->delete($pathname); - throw new Exception('图片[' . $image->getInfo('name') . ']涉嫌违规,禁止上传!');*/ + // 是否直接拦截色情图片 + if (Config::get('site.intercept_salacity')) { + $strategy->delete($pathname); + throw new Exception('图片[' . $image->getInfo('name') . ']涉嫌违规,禁止上传!'); + } $suspicious = 1; } } else { diff --git a/config/site.php b/config/site.php new file mode 100644 index 00000000..469f3670 --- /dev/null +++ b/config/site.php @@ -0,0 +1,12 @@ + false, +];