diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 150f43d..e3f5e1f 100755
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1 @@
-custom: ['https://png.cm/sponsor/images/wechat.jpg']
\ No newline at end of file
+custom: ['https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.5/public/images/wechat.jpg']
\ No newline at end of file
diff --git a/README.md b/README.md
index fabb7c6..acb2b3a 100755
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
>本人善写bug 发现bug可提交 [issues](https://github.com/icret/EasyImages2.0/issues) 追求稳定请下载 [稳定版](https://github.com/icret/EasyImages2.0/releases)
## 目录
-[特点](#特点) [使用注意](#使用注意) [安装](#安装) [程序升级](#程序升级) [安全配置](#安全配置) [更新日志](#更新日志) [支持开发者](#支持开发者) [界面演示](#界面演示) [兼容](#兼容) [鸣谢](#鸣谢) [开源许可](#开源许可)
+[特点](#特点) [使用注意](#使用注意) [安装](#安装) [程序升级](#程序升级) [安全配置](#安全配置) [更新日志](#更新日志) [支持开发者](#支持开发者) [界面演示](#界面演示) [兼容](#兼容) [鸣谢](#鸣谢) [开源许可](#开源许可)
## 特点
@@ -68,7 +68,7 @@
## 程序升级
-- 备份`config`(没有增加上传用户和api可以只保留`config.php`文件)目录和`上传目录`
+- 备份`config`目录(没有增加上传用户和api可以只保留`config.php`文件)和`图片目录`
- 将新程序下载至网站目录解压覆盖,然后将备份的文件替换既完成升级
## 安全配置
@@ -104,6 +104,9 @@ $HTTP["url"] =~ "^/(i|public)/" {
当前PHP版本: upload_max_filesize - PHP上传最大值: PHP最大上传: post_max_size - POST上传最大值: POST最大上传: 点击查看2.0版更新日志
+* 2022-3-7 v2.5.6 dev
+- 修复加密删除后不能正确提示
+
* 2022-3-4 v2.5.5
- 增加设置页面检测是否开启登录上传
- 将footer固定在底部
diff --git a/application/check.php b/application/check.php
index e556069..df38a44 100755
--- a/application/check.php
+++ b/application/check.php
@@ -28,9 +28,9 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定
EasyImage2.0 基础检测:
/i 目录可读写
+' . $config['path'] . ' 目录可读写
'; } if (!IS_WIN) { - if ($quanxian !== '755' and !is_writable(APP_ROOT . '/i/')) { + if ($quanxian !== '755' and !is_writable(APP_ROOT . $config['path'])) { echo 'upload.php 文件不可执行> -
/i 目录可读写> +
' . $config['path'] . ' 目录可读写> '; } else { echo '
upload.php 文件可执行
-/i 目录可读写
+' . $config['path'] . ' 目录可读写
'; } } diff --git a/application/del.php b/application/del.php index c6e99cb..1bdf10b 100755 --- a/application/del.php +++ b/application/del.php @@ -44,8 +44,8 @@ if (isset($_GET['hash'])) { if ($config['image_recycl']) { // 如果开启回收站则进入回收站 - checkImg($delHash, 3, 'recycle/'); - echo ' + if (checkImg($delHash, 3, 'recycle/') == true) { + echo ' '; + } else { + echo ' + + '; + } } else { // 否则直接删除 getDel($delHash, 'url'); diff --git a/application/function.php b/application/function.php index cacc5e0..8dcb0c2 100755 --- a/application/function.php +++ b/application/function.php @@ -6,7 +6,7 @@ require_once APP_ROOT . '/config/config.guest.php'; /** * 判断GIF图片是否为动态 * @param $filename string 文件 - * @return int + * @return int 是|否 */ function isAnimatedGif($filename) { @@ -155,18 +155,20 @@ function static_cdn() echo $config['domain']; } } -/* -// 获取允许上传的扩展名 + +/** + * 获取允许上传的扩展名 + */ function getExtensions() { global $config; + $arr = explode(',', $config['extensions']); $mime = ''; - for ($i = 0; $i < count($config['extensions']); $i++) { - $mime .= $config['extensions'][$i] . ','; + for ($i = 0; $i < count($arr); $i++) { + $mime .= $arr . ','; } return rtrim($mime, ','); } -*/ /** * 获取目录大小 如果目录文件较多将很费时 @@ -656,7 +658,10 @@ function nsfwjs_json($url, $data = '') /** * 检查图片是否违规 - * @param $imageUrl string 图片url + * @param $imageUrl 图片链接 + * @param int $type 模式: 1|moderatecontent 2|nsfwjs 3|移入回收站 + * @param string $dir 移入的目录 + * @return bool */ function checkImg($imageUrl, $type = 1, $dir = 'suspic/') { @@ -730,13 +735,18 @@ function checkImg($imageUrl, $type = 1, $dir = 'suspic/') if ($bad_pic == true) { $old_path = APP_ROOT . str_replace($config['imgurl'], '', $imageUrl); // 提交网址中的文件路径 /i/2021/10/29/p8vypd.png $name = date('Y_m_d') . '_' . basename($imageUrl); // 文件名 2021_10_30_p8vypd.png - $new_path = APP_ROOT . $config['path'] . $dir . $name; // 新路径含文件名 - $suspic_dir = APP_ROOT . $config['path'] . $dir; // suspic路径 + $new_path = APP_ROOT . $config['path'] . $dir . $name; // 新路径含文件名 + $suspic_dir = APP_ROOT . $config['path'] . $dir; // suspic路径 - if (!is_dir($suspic_dir)) { // 创建suspic目录并移动 + if (!is_dir($suspic_dir)) { // 创建suspic目录并移动 mkdir($suspic_dir, 0777, true); } - rename($old_path, $new_path); + if (is_file($old_path)) { + rename($old_path, $new_path); + return true; + } else { + return false; + } } } @@ -1105,7 +1115,7 @@ function check_api($token) global $tokenList; if (!$config['apiStatus']) { - // API关闭 服务端关闭API上传 + // 关闭API $reJson = array( "result" => 'failed', 'code' => 201, @@ -1115,7 +1125,7 @@ function check_api($token) } if (!in_array($tokenList[$token], $tokenList)) { - // Token 是否存在 + // Token 存在 $reJson = array( "result" => 'failed', 'code' => 202, @@ -1125,7 +1135,7 @@ function check_api($token) } if ($tokenList[$token]['expired'] < time()) { - // Token 是否过期 + // Token 过期 $reJson = array( "result" => 'failed', 'code' => 203, diff --git a/application/header.php b/application/header.php index 770a75d..2d7eb70 100755 --- a/application/header.php +++ b/application/header.php @@ -12,7 +12,7 @@