diff --git a/README.md b/README.md index 2b5c063..ecea202 100755 --- a/README.md +++ b/README.md @@ -230,7 +230,10 @@ $HTTP["url"] =~ "^/(i|public)/" {
点击查看2.0版更新日志 -* 2023-02-05 v2.7.2 +* 2023-02-05 v2.7.4 dev +- 此版本将作为优化和修复bugs + +* 2023-02-05 v2.7.3 - 修复设置中手动压缩失败! - 优化排版 diff --git a/admin/admin.inc.php b/admin/admin.inc.php index 15524e8..b0d121b 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -440,7 +440,7 @@ if (isset($_POST['del_version_file'])) {
- +
@@ -451,7 +451,7 @@ if (isset($_POST['del_version_file'])) {
- +
" placeholder="隐藏的保存"> @@ -590,7 +590,7 @@ if (isset($_POST['del_version_file'])) { >
- +
@@ -896,7 +896,7 @@ if (isset($_POST['del_version_file'])) { Manual Telegram Discuss - +

@@ -936,12 +936,12 @@ if (isset($_POST['del_version_file'])) { @@ -1251,7 +1251,6 @@ if (isset($_POST['del_version_file'])) { -
前端裁剪/压缩 优点:服务器无压力 缺点:PC配置低的会导致浏览器卡顿,偶现丢失方向信息,仅支持JPG
diff --git a/admin/version.php b/admin/version.php index fbafd6b..61d459b 100644 --- a/admin/version.php +++ b/admin/version.php @@ -1 +1 @@ -2.7.2 \ No newline at end of file +2.7.4 dev \ No newline at end of file diff --git a/api/index.php b/api/index.php index a2d30d3..b7a71b3 100755 --- a/api/index.php +++ b/api/index.php @@ -193,7 +193,7 @@ if ($handle->uploaded) { // 记录同IP上传次数 @ip_upload_counts(); // 上传日志 - if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, $tokenID); + @write_upload_logs($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, $tokenID); // 鉴黄 @process_checkImg($processUrl); // 水印 @@ -204,7 +204,7 @@ if ($handle->uploaded) { // 记录同IP上传次数 @ip_upload_counts(); // 上传日志 - if ($config['upload_logs']) write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, $tokenID); + @write_upload_logs($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size, $tokenID); // 鉴黄 @process_checkImg($processUrl); // 水印 diff --git a/application/function.php b/application/function.php index b11527b..d7874a8 100755 --- a/application/function.php +++ b/application/function.php @@ -1623,10 +1623,14 @@ function process_checkImg($imgurl) * $fileSize 图片的大小 * $form 来源如果是网页上传直接显示网页,如果是API上传则显示ID */ -function write_log($filePath, $sourceName, $absolutePath, $fileSize, $from = "web") +function write_upload_logs($filePath, $sourceName, $absolutePath, $fileSize, $from = "web") { global $config; + if (!$config['upload_logs']) { + return null; + } + $checkImg = $config['checkImg'] == true ? "ON" : "OFF"; // $name = trim(basename($filePath), " \t\n\r\0\x0B"); // 当前图片名称 @@ -1718,12 +1722,14 @@ function ip2region(String $IP) */ function ip_upload_counts() { - $dir = APP_ROOT . '/admin/logs/ipcounts/'; + global $config; - if (!is_dir($dir)) { - mkdir($dir, 0777); + if ($config['ip_upload_counts'] > 0) { + + $dir = APP_ROOT . '/admin/logs/ipcounts/'; + if (!is_dir($dir)) mkdir($dir, 0777); + + $file = $dir . date('Ymd') . '.php'; + file_put_contents($file, real_ip() . PHP_EOL, FILE_APPEND | LOCK_EX); } - - $file = $dir . date('Ymd') . '.php'; - file_put_contents($file, real_ip() . PHP_EOL, FILE_APPEND | LOCK_EX); } diff --git a/application/upload.php b/application/upload.php index 9017e59..a73b2b4 100755 --- a/application/upload.php +++ b/application/upload.php @@ -213,20 +213,18 @@ if ($handle->uploaded) { // 同IP上传日志 @ip_upload_counts(); // 日志 - if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size); + @write_upload_logs($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size); // 鉴黄 @process_checkImg($processUrl); - // 日志 - if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size); // 水印 @water($handle->file_dst_pathname); // 压缩 - @ip_upload_counts(); + @process_compress($handle->file_dst_pathname); } else { // 普通模式 // 记录同IP上传次数 @ip_upload_counts(); // 日志 - if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size); + @write_upload_logs($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size); // 鉴黄 @process_checkImg($processUrl); // 水印 diff --git a/config/config.php b/config/config.php index c5d4323..fa4195d 100755 --- a/config/config.php +++ b/config/config.php @@ -115,7 +115,7 @@ $config=Array 'guest_path_status'=>0, 'token_path_status'=>0, 'admin_path'=>'u', - 'update'=>'2023-02-05 02:23:46', + 'update'=>'2023-02-05 13:22:16', 'footer'=>'© Since 2018 EasyImage DMCA