优化和修复bugs
parent
60d0192bbc
commit
ee0abc2bb6
|
@ -230,7 +230,10 @@ $HTTP["url"] =~ "^/(i|public)/" {
|
||||||
|
|
||||||
<details><summary>点击查看2.0版更新日志</summary>
|
<details><summary>点击查看2.0版更新日志</summary>
|
||||||
|
|
||||||
* 2023-02-05 v2.7.2
|
* 2023-02-05 v2.7.4 dev
|
||||||
|
- 此版本将作为优化和修复bugs
|
||||||
|
|
||||||
|
* 2023-02-05 v2.7.3
|
||||||
- 修复设置中手动压缩失败!
|
- 修复设置中手动压缩失败!
|
||||||
- 优化排版
|
- 优化排版
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,7 @@ if (isset($_POST['del_version_file'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>顶部广告内容 | 仅支持html代码</label>
|
<label>顶部广告内容 | 仅支持html代码</label>
|
||||||
<textarea class="form-control" rows="5" name="ad_top_info"><?php echo $config['ad_top_info']; ?></textarea>
|
<textarea class="form-control" rows="8" name="ad_top_info"><?php echo $config['ad_top_info']; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="switch switch-inline">
|
<div class="switch switch-inline">
|
||||||
|
@ -451,7 +451,7 @@ if (isset($_POST['del_version_file'])) {
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>底部广告内容 | 仅支持html代码</label>
|
<label>底部广告内容 | 仅支持html代码</label>
|
||||||
<textarea class="form-control" rows="5" name="ad_bot_info"><?php echo $config['ad_bot_info']; ?></textarea>
|
<textarea class="form-control" rows="8" name="ad_bot_info"><?php echo $config['ad_bot_info']; ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="hidden" class="form-control" name="update" value="<?php echo date("Y-m-d H:i:s"); ?>" placeholder="隐藏的保存">
|
<input type="hidden" class="form-control" name="update" value="<?php echo date("Y-m-d H:i:s"); ?>" placeholder="隐藏的保存">
|
||||||
|
@ -590,7 +590,7 @@ if (isset($_POST['del_version_file'])) {
|
||||||
<input type="checkbox" name="check_ip" value="1" <?php if ($config['check_ip']) echo 'checked="checked"'; ?>>
|
<input type="checkbox" name="check_ip" value="1" <?php if ($config['check_ip']) echo 'checked="checked"'; ?>>
|
||||||
<label style="font-weight: bold">黑/白IP名单上传</label>
|
<label style="font-weight: bold">黑/白IP名单上传</label>
|
||||||
</div>
|
</div>
|
||||||
<textarea class="form-control" rows="5" name="check_ip_list" data-toggle="tooltip" title="每个IP以英文,结尾 支持IP段 例:123.23.23.44,193.134.*.*" placeholder=" 每个IP以英文,结尾 支持IP段 例:192.168.1.13,123.23.23.44,193.134.*.*"><?php echo $config['check_ip_list']; ?></textarea>
|
<textarea class="form-control" rows="3" name="check_ip_list" data-toggle="tooltip" title="每个IP以英文,结尾 支持IP段 例:123.23.23.44,193.134.*.*" placeholder=" 每个IP以英文,结尾 支持IP段 例:192.168.1.13,123.23.23.44,193.134.*.*"><?php echo $config['check_ip_list']; ?></textarea>
|
||||||
<label class="radio-inline"><input type="radio" name="check_ip_model" value="0" <?php if ($config['check_ip_model'] == 0) echo 'checked'; ?>> 黑名单模式</label>
|
<label class="radio-inline"><input type="radio" name="check_ip_model" value="0" <?php if ($config['check_ip_model'] == 0) echo 'checked'; ?>> 黑名单模式</label>
|
||||||
<label class="radio-inline"><input type="radio" name="check_ip_model" value="1" <?php if ($config['check_ip_model'] == 1) echo 'checked'; ?>> 白名单模式</label>
|
<label class="radio-inline"><input type="radio" name="check_ip_model" value="1" <?php if ($config['check_ip_model'] == 1) echo 'checked'; ?>> 白名单模式</label>
|
||||||
</div>
|
</div>
|
||||||
|
@ -896,7 +896,7 @@ if (isset($_POST['del_version_file'])) {
|
||||||
<a href="https://www.kancloud.cn/easyimage/easyimage/content" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="使用手册"><i class="icon icon-book"></i> Manual</span></a>
|
<a href="https://www.kancloud.cn/easyimage/easyimage/content" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="使用手册"><i class="icon icon-book"></i> Manual</span></a>
|
||||||
<a href="https://t.me/Easy_Image" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="EasyImage Telegram Group"><i class="icon icon-comments-alt"></i> Telegram</span></a>
|
<a href="https://t.me/Easy_Image" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="EasyImage Telegram Group"><i class="icon icon-comments-alt"></i> Telegram</span></a>
|
||||||
<a href="https://github.com/icret/EasyImages2.0/discussions" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="GitHub 社区"><i class="icon icon-comments-alt"></i> Discuss</span></a>
|
<a href="https://github.com/icret/EasyImages2.0/discussions" target="_blank"><span class="label label-badge label-primary" data-toggle="tooltip" title="GitHub 社区"><i class="icon icon-comments-alt"></i> Discuss</span></a>
|
||||||
<span class="label label-badge label-primary" data-toggle="tooltip" title="当前版本"><i class="icon icon-github"></i> <?php echo get_current_version(); ?></span>
|
<span data-toggle="tooltip" title="当前版本信息"><button type="button" class="btn btn-sm btn-primary label label-badge" data-toggle="modal" data-moveable="true" data-scroll-inside="true" data-icon="heart" data-title="当前版本信息" data-custom="<pre style='background-color: rgba(0, 0, 0, 0);border-color:rgba(0, 0, 0, 0);'><?php echo getVersion('name') . '<br/><br/>' . getVersion('body'); ?></pre>"><i class="icon icon-github"></i> <?php echo get_current_version(); ?></button></span>
|
||||||
<a href="../public/images/wechat.jpg" data-toggle="lightbox" style="color:#329d38;"><i data-toggle="tooltip" title="您的赞美是我开发的动力!" class="icon icon-wechat"></i></a>
|
<a href="../public/images/wechat.jpg" data-toggle="lightbox" style="color:#329d38;"><i data-toggle="tooltip" title="您的赞美是我开发的动力!" class="icon icon-wechat"></i></a>
|
||||||
<a href="../public/images/alipay.jpg" data-toggle="lightbox" class="hidden-xs inline-block" style="color:#1970fc;"><i class="icon icon-zhifubao" data-toggle="tooltip" title="您的赞美是我开发的动力!"> </i></a>
|
<a href="../public/images/alipay.jpg" data-toggle="lightbox" class="hidden-xs inline-block" style="color:#1970fc;"><i class="icon icon-zhifubao" data-toggle="tooltip" title="您的赞美是我开发的动力!"> </i></a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -936,12 +936,12 @@ if (isset($_POST['del_version_file'])) {
|
||||||
<div class="bg-warning with-padding hidden-xs">
|
<div class="bg-warning with-padding hidden-xs">
|
||||||
<h5 class="header-dividing"><span class="label label-success">New</span> <?php echo getVersion('name'); ?></h5>
|
<h5 class="header-dividing"><span class="label label-success">New</span> <?php echo getVersion('name'); ?></h5>
|
||||||
<pre style="background-color: rgba(0, 0, 0, 0);border-color:rgba(0, 0, 0, 0);">更新内容: <br /><?php echo getVersion('body'); ?></pre>
|
<pre style="background-color: rgba(0, 0, 0, 0);border-color:rgba(0, 0, 0, 0);">更新内容: <br /><?php echo getVersion('body'); ?></pre>
|
||||||
<h6>* 更新日期: <?php echo getVersion('created_at'); ?> 下载新版本上传更新, 然后点击更新版本号。</h6>
|
<h6>* 更新日期: <?php echo getVersion('created_at'); ?> 下载新版本上传至网站升级, 然后点击更新版本号。</h6>
|
||||||
<form action="<?php $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
<form action="<?php $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||||
<input class="form-control" type="hidden" name="del_version_file" value="/admin/logs/version/version.json" readonly>
|
<input class="form-control" type="hidden" name="del_version_file" value="/admin/logs/version/version.json" readonly>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button class="btn btn-mini btn-primary" href="<?php echo getVersion('zipball_url'); ?>" target="_blank">下载新版本</button>
|
<a class="btn btn-mini btn-primary" href="<?php echo getVersion('zipball_url'); ?>" target="_blank" data-toggle="tooltip" title="① 下载后上传至网站更新">下载新版本</a>
|
||||||
<button class="btn btn-mini btn-danger">更新版本号</button>
|
<button class="btn btn-mini btn-danger" data-toggle="tooltip" title="② 升级后获取新的版本信息">更新版本号</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1251,7 +1251,6 @@ if (isset($_POST['del_version_file'])) {
|
||||||
<button type="submit" class="btn btn-primary">保存</button>
|
<button type="submit" class="btn btn-primary">保存</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="Content13">
|
<div class="tab-pane fade" id="Content13">
|
||||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||||
<h5 class="header-dividing">前端裁剪/压缩 <small>优点:服务器无压力 缺点:PC配置低的会导致浏览器卡顿,偶现丢失方向信息,仅支持JPG</small></h5>
|
<h5 class="header-dividing">前端裁剪/压缩 <small>优点:服务器无压力 缺点:PC配置低的会导致浏览器卡顿,偶现丢失方向信息,仅支持JPG</small></h5>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
2.7.2
|
2.7.4 dev
|
|
@ -193,7 +193,7 @@ if ($handle->uploaded) {
|
||||||
// 记录同IP上传次数
|
// 记录同IP上传次数
|
||||||
@ip_upload_counts();
|
@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);
|
@process_checkImg($processUrl);
|
||||||
// 水印
|
// 水印
|
||||||
|
@ -204,7 +204,7 @@ if ($handle->uploaded) {
|
||||||
// 记录同IP上传次数
|
// 记录同IP上传次数
|
||||||
@ip_upload_counts();
|
@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);
|
@process_checkImg($processUrl);
|
||||||
// 水印
|
// 水印
|
||||||
|
|
|
@ -1623,10 +1623,14 @@ function process_checkImg($imgurl)
|
||||||
* $fileSize 图片的大小
|
* $fileSize 图片的大小
|
||||||
* $form 来源如果是网页上传直接显示网页,如果是API上传则显示ID
|
* $form 来源如果是网页上传直接显示网页,如果是API上传则显示ID
|
||||||
*/
|
*/
|
||||||
function write_log($filePath, $sourceName, $absolutePath, $fileSize, $from = "web")
|
function write_upload_logs($filePath, $sourceName, $absolutePath, $fileSize, $from = "web")
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if (!$config['upload_logs']) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$checkImg = $config['checkImg'] == true ? "ON" : "OFF";
|
$checkImg = $config['checkImg'] == true ? "ON" : "OFF";
|
||||||
|
|
||||||
// $name = trim(basename($filePath), " \t\n\r\0\x0B"); // 当前图片名称
|
// $name = trim(basename($filePath), " \t\n\r\0\x0B"); // 当前图片名称
|
||||||
|
@ -1718,12 +1722,14 @@ function ip2region(String $IP)
|
||||||
*/
|
*/
|
||||||
function ip_upload_counts()
|
function ip_upload_counts()
|
||||||
{
|
{
|
||||||
$dir = APP_ROOT . '/admin/logs/ipcounts/';
|
global $config;
|
||||||
|
|
||||||
if (!is_dir($dir)) {
|
if ($config['ip_upload_counts'] > 0) {
|
||||||
mkdir($dir, 0777);
|
|
||||||
|
$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);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,20 +213,18 @@ if ($handle->uploaded) {
|
||||||
// 同IP上传日志
|
// 同IP上传日志
|
||||||
@ip_upload_counts();
|
@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);
|
@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);
|
@water($handle->file_dst_pathname);
|
||||||
// 压缩
|
// 压缩
|
||||||
@ip_upload_counts();
|
@process_compress($handle->file_dst_pathname);
|
||||||
} else { // 普通模式
|
} else { // 普通模式
|
||||||
// 记录同IP上传次数
|
// 记录同IP上传次数
|
||||||
@ip_upload_counts();
|
@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);
|
@process_checkImg($processUrl);
|
||||||
// 水印
|
// 水印
|
||||||
|
|
|
@ -115,7 +115,7 @@ $config=Array
|
||||||
'guest_path_status'=>0,
|
'guest_path_status'=>0,
|
||||||
'token_path_status'=>0,
|
'token_path_status'=>0,
|
||||||
'admin_path'=>'u',
|
'admin_path'=>'u',
|
||||||
'update'=>'2023-02-05 02:23:46',
|
'update'=>'2023-02-05 13:22:16',
|
||||||
'footer'=>'<a href="https://github.com/icret/EasyImages2.0" target="_blank" rel="nofollow" data-toggle="tooltip" title="Since 2018 - Github">© Since 2018</a>
|
'footer'=>'<a href="https://github.com/icret/EasyImages2.0" target="_blank" rel="nofollow" data-toggle="tooltip" title="Since 2018 - Github">© Since 2018</a>
|
||||||
<a href="https://png.cm/" target="_blank" data-toggle="tooltip" title="EasyImage 简单图床">EasyImage</a>
|
<a href="https://png.cm/" target="_blank" data-toggle="tooltip" title="EasyImage 简单图床">EasyImage</a>
|
||||||
<a href="/admin/terms.php" target="_blank" data-toggle="tooltip" title="使用协议">DMCA</a>
|
<a href="/admin/terms.php" target="_blank" data-toggle="tooltip" title="使用协议">DMCA</a>
|
||||||
|
|
Loading…
Reference in New Issue