Skip to content

Commit bbcf8af

Browse files
committed
更新API规则
1 parent 63066b6 commit bbcf8af

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

api/index.php

+16
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,22 @@
111111

112112
// 图片完整相对路径:/i/2021/05/03/k88e7p.jpg
113113
if ($handle->processed) {
114+
// 黑名单文件 - 通过MD5检测
115+
if ($config['md5_black']) {
116+
$befor_upload_file_md5 = md5_file($handle->file_src_pathname);
117+
$after_upload_file_md5 = md5_file($handle->file_dst_pathname);
118+
if (stristr($config['md5_blacklist'], $befor_upload_file_md5) || stristr($config['md5_blacklist'], $after_upload_file_md5)) {
119+
if (file_exists($handle->file_dst_pathname)) unlink($handle->file_dst_pathname);
120+
exit(json_encode(
121+
array(
122+
"result" => "failed",
123+
"code" => 205,
124+
"message" => "当前文件禁止上传",
125+
),
126+
JSON_UNESCAPED_UNICODE
127+
));
128+
}
129+
}
114130
// 图片相对路径
115131
$pathIMG = $Img_path . $handle->file_dst_name;
116132
// 图片访问网址

docs/图床更新升级.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
2. 保留挂载在主机上的配置文件和上传文件夹
1010
3. 重新执行一边docker安装代码
1111

12+
##### 全新安装
13+
1. 备份`上传文件目录`
14+
2. 将新程序下载至网站目录解压覆盖,然后将备份的文件替换既重装完成
15+
1216
##### 更新后显示当前版本与Github版本不一致?
1317

1418
- 将最新版按照[正常升级](#正常升级)操作

0 commit comments

Comments
 (0)