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, +];