增加前端上传签名

pull/141/head
icret 2023-03-05 23:11:00 +08:00
parent 133bd5c03a
commit a7ab58f4b9
4 changed files with 5 additions and 4 deletions

View File

@ -28,7 +28,7 @@ if (empty($_FILES['file'])) {
}
// sign
if (empty($_POST['sign']) || $_POST['sign'] !== md5($config['password'] . date('YmdH'))) {
if (empty($_REQUEST['sign']) || $_REQUEST['sign'] !== date('YmdH')) {
exit(json_encode(array(
"result" => "failed",
"code" => 403,

View File

@ -1,5 +1,5 @@
* 2023-03-06 v2.7.8
- 增加端上传签名
- 增加WEB端上传签名
* 2023-03-05 v2.7.7
- 增加登录日志

View File

@ -130,7 +130,8 @@ mustLogin();
flash_swf_url: '<?php static_cdn(); ?>/public/static/zui/lib/uploader/Moxie.xap',
// sign
multipart_params: {
'sign': '<?php echo md5($config['password'] . date('YmdH')); ?>', // new Date().format("YYYYMMddhh")
// 'sign': new Date().format("YYYYMMddhh"),
'sign': new Date().format("YYYYMMddhh"),
},
// 预览图尺寸
previewImageSize: {

View File

@ -287,7 +287,7 @@ $('#btnLinks, #btnBbscode, #btnMarkDown, #btnHtml, #btnThumb, #btnDel').on('clic
placement: 'top'
});
};
xhr.open('POST', './application/upload.php', true);
xhr.open('POST', './application/upload.php?sign=' + new Date().format("YYYYMMddhh"), true);
xhr.send(formData);
});
})();