From 9dda902bc36220753ec354c7be35b1ab48eaa4f9 Mon Sep 17 00:00:00 2001 From: = <=> Date: Fri, 4 Feb 2022 16:09:44 +0100 Subject: [PATCH] v2.4.8 --- README.md | 3 ++- api/index.php | 2 +- application/thumb.php | 7 +++++-- application/upload.php | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b10da94..370dc88 100755 --- a/README.md +++ b/README.md @@ -101,12 +101,13 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 * 2022-1-28 v2.4.8 dev +- 调整缩略图内存至128M - 修复无可疑图片时显示错误 - 修复转换为webp时会复制一份bug - 修复开启登录上传后无法上传的bug +- 插件检测的敏感信息转移到管理目录 - 增加安装时检测.user.ini - 增加检测鉴黄接口是否可以正确访问 -- 将插件检测等敏感信息转义到管理目录 - 增加异步处理文件,上传完毕后处理速度变快了 - 增加 [nsfwjs](https://github.com/infinitered/nsfwjs) 接口方式检测违规图片 - 作者测试时用的`docker`搭建 `docker`地址:[zengdawei/nsfw_restful_api diff --git a/api/index.php b/api/index.php index 16e73f3..7f395f2 100755 --- a/api/index.php +++ b/api/index.php @@ -87,7 +87,7 @@ if ($handle->uploaded) { require APP_ROOT . '/application/process.php'; // 普通模式鉴黄 - process_checkImg($imageUrl); + @process_checkImg($imageUrl); // 使用fastcgi_finish_request操作 if (function_exists('fastcgi_finish_request')) { diff --git a/application/thumb.php b/application/thumb.php index a5c0e7b..68c746b 100755 --- a/application/thumb.php +++ b/application/thumb.php @@ -46,16 +46,19 @@ Thumb::show($src, $w, $h); require_once __DIR__ . '/function.php'; +// 中文翻译 https://my.oschina.net/whrlmc/blog/81739 define('LOCAL_FILE_BASE_DIRECTORY', APP_ROOT); +define('MEMORY_LIMIT', '128M'); define('DEFAULT_WIDTH', 258); define('DEFAULT_HEIGHT', 258); define('FILE_CACHE_PREFIX', 'EasyImage'); define('DEFAULT_ZC', 0); + define('MAX_WIDTH', 10240); define('MAX_HEIGHT', 10240); define('FILE_CACHE_DIRECTORY', APP_ROOT . $config['path'] . 'thumbnails'); -define('NOT_FOUND_IMAGE', '../public/images/404.png'); -define('ERROR_IMAGE', '无法生成缩略图'); +define('NOT_FOUND_IMAGE', $config['imgurl'] . '/public/images/404.png'); +define('ERROR_IMAGE', $config['imgurl'] . '/public/images/404.png'); define('DISPLAY_ERROR_MESSAGES', false); define('MAX_FILE_SIZE', 10485760); // 10 Megs 是 10485760。这是我们将处理的最大内部或外部文件大小。 define('FILE_CACHE_TIME_BETWEEN_CLEANS', 86400); // 多久清理一次缓存 diff --git a/application/upload.php b/application/upload.php index a5a3356..6dfd527 100755 --- a/application/upload.php +++ b/application/upload.php @@ -113,7 +113,7 @@ if ($handle->uploaded) { } */ // 普通模式鉴黄 - process_checkImg($imageUrl); + @process_checkImg($imageUrl); // 使用fastcgi_finish_request操作 if (function_exists('fastcgi_finish_request')) {