pull/141/head
icret 2022-03-07 12:34:04 +08:00
parent 5f2ffb5c7b
commit 8b05affa30
10 changed files with 134 additions and 111 deletions

2
.github/FUNDING.yml vendored
View File

@ -1 +1 @@
custom: ['https://png.cm/sponsor/images/wechat.jpg']
custom: ['https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.5/public/images/wechat.jpg']

View File

@ -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)/" {
<details><summary><mark>点击查看2.0版更新日志</mark></summary>
* 2022-3-7 v2.5.6 dev
- 修复加密删除后不能正确提示
* 2022-3-4 v2.5.5
- 增加设置页面检测是否开启登录上传
- 将footer固定在底部

View File

@ -28,9 +28,9 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定
<h4>EasyImage2.0 基础检测:</h4>
<p>当前PHP版本:<sapn style="color:green"><?php echo phpversion() ?></sapn>
</p>
<p>upload_max_filesize - PHP上传最大值:<sapn style="color:green"><?php echo ini_get('upload_max_filesize'); ?></sapn>
<p>PHP最大上传: <sapn style="color:green"><?php echo ini_get('upload_max_filesize'); ?></sapn>
</p>
<p>post_max_size - POST上传最大值:<sapn style="color:green"><?php echo ini_get('post_max_size'); ?></sapn>
<p>POST最大上传: <sapn style="color:green"><?php echo ini_get('post_max_size'); ?></sapn>
</p>
<?php
// 扩展检测 取消检测imagick扩展
@ -49,19 +49,19 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定
if (IS_WIN) {
echo '
<p style="color:green">upload.php 文件可执行</p>
<p style="color:green">/i 目录可读写</p>
<p style="color:green">' . $config['path'] . ' 目录可读写</p>
';
}
if (!IS_WIN) {
if ($quanxian !== '755' and !is_writable(APP_ROOT . '/i/')) {
if ($quanxian !== '755' and !is_writable(APP_ROOT . $config['path'])) {
echo '
<p style="color:red">upload.php 文件不可执行</font>>
<p style="color:red">/i 目录可读写</font>>
<p style="color:red">' . $config['path'] . ' 目录可读写</font>>
';
} else {
echo '
<p style="color:green">upload.php 文件可执行</p>
<p style="color:green">/i 目录可读写</p>
<p style="color:green">' . $config['path'] . ' 目录可读写</p>
';
}
}

View File

@ -44,8 +44,8 @@ if (isset($_GET['hash'])) {
if ($config['image_recycl']) {
// 如果开启回收站则进入回收站
checkImg($delHash, 3, 'recycle/');
echo '
if (checkImg($delHash, 3, 'recycle/') == true) {
echo '
<script>
new $.zui.Messager("删除成功", {
type: "success", // 定义颜色主题
@ -53,6 +53,16 @@ if (isset($_GET['hash'])) {
}).show();
</script>
';
} else {
echo '
<script>
new $.zui.Messager("文件不存在!", {
type: "danger", // 定义颜色主题
icon: "exclamation-sign" // 定义消息图标
}).show();
</script>
';
}
} else {
// 否则直接删除
getDel($delHash, 'url');

View File

@ -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,

View File

@ -12,7 +12,7 @@
<title><?php echo $config['title']; ?></title>
<meta name="keywords" content="<?php echo $config['keywords']; ?>" />
<meta name="description" content="<?php echo $config['description']; ?>" />
<link rel="shortcut icon" href="<?php echo $config['domain']; ?>/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php static_cdn(); ?>/favicon.ico" type="image/x-icon" />
<link href="<?php static_cdn(); ?>/public/static/zui/css/zui.min.css" rel="stylesheet">
<link href="<?php static_cdn(); ?>/public/static/zui/theme/zui-theme-<?php echo $config['theme']; ?>.css" rel="stylesheet">
<script src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>

View File

@ -1,52 +1,52 @@
<?php
$config=Array
(
'title'=>'简单图床 - EasyImage',
'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序最新html5自适应页面兼容手机电脑上传后返回图片直链markdown图片论坛贴图bbscode链接简单方便支持一键复制支持多域名api上传。',
$config=Array
(
'title'=>'简单图床 - EasyImage',
'keywords'=>'简单图床,easyimage,无数据库图床,PHP多图长传程序,自适应页面,HTML5,markdown,bbscode,一键复制',
'description'=>'简单图床EasyImage是一款支持多文件上传的无数据库图床,可以完美替代PHP多图上传程序最新html5自适应页面兼容手机电脑上传后返回图片直链markdown图片论坛贴图bbscode链接简单方便支持一键复制支持多域名api上传。',
'tips'=>'<a><li class="icon icon-bullhorn text-muted"> 单文件≤10M单次上传≤30张</li></a>
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-heart"> 简单图床是一款开源图床, 支持多文件上传无数据库</i></a>
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-github"> 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧</i></a>',
'domain'=>'http://127.0.0.1',
'imgurl'=>'http://127.0.0.1',
'user'=>'admin',
'password'=>'e6e061838856bf47e1de730719fb2609',
'mustLogin'=>0,
'apiStatus'=>1,
'path'=>'/i/',
'imgName'=>'default',
'maxSize'=>10485760,
'maxUploadFiles'=>100,
'watermark'=>0,
'waterText'=>'简单图床 - png.cm',
'waterPosition'=>0,
'textColor'=>'255,0,0,1',
'textSize'=>50,
'textFont'=>'/public/static/hkxzy.ttf',
'waterImg'=>'/public/images/watermark.png',
'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico',
'compress'=>0,
'compress_ratio'=>80,
'thumbnail'=>1,
'imgConvert'=>'',
'maxWidth'=>10240,
'maxHeight'=>10240,
'minWidth'=>5,
'minHeight'=>5,
'imgRatio'=>0,
'image_x'=>0,
'image_y'=>0,
'imgRatio_quality'=>80,
'imgRatio_crop'=>0,
'imgRatio_preserve_headers'=>1,
'static_cdn'=>1,
'theme'=>'default',
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
'TinyPng_key'=>'',
'checkImg'=>0,
'checkImg_value'=>50,
'moderatecontent_key'=>'',
'nsfwjs_url'=>'',
<a href="https://github.com/icret/EasyImages2.0" target="_black"><i class="icon icon-github"> 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧</i></a>',
'domain'=>'http://127.0.0.1',
'imgurl'=>'http://127.0.0.1',
'user'=>'admin',
'password'=>'e6e061838856bf47e1de730719fb2609',
'mustLogin'=>0,
'apiStatus'=>0,
'path'=>'/i/',
'imgName'=>'default',
'maxSize'=>10485760,
'maxUploadFiles'=>100,
'watermark'=>0,
'waterText'=>'简单图床 - png.cm',
'waterPosition'=>0,
'textColor'=>'255,0,0,1',
'textSize'=>50,
'textFont'=>'/public/static/hkxzy.ttf',
'waterImg'=>'/public/images/watermark.png',
'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico',
'compress'=>0,
'compress_ratio'=>80,
'thumbnail'=>1,
'imgConvert'=>'',
'maxWidth'=>10240,
'maxHeight'=>10240,
'minWidth'=>5,
'minHeight'=>5,
'imgRatio'=>0,
'image_x'=>0,
'image_y'=>0,
'imgRatio_quality'=>80,
'imgRatio_crop'=>0,
'imgRatio_preserve_headers'=>1,
'static_cdn'=>1,
'theme'=>'default',
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.5',
'TinyPng_key'=>'',
'checkImg'=>0,
'checkImg_value'=>50,
'moderatecontent_key'=>'',
'nsfwjs_url'=>'',
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
<script>
var _hmt = _hmt || [];
@ -56,50 +56,50 @@ var _hmt = _hmt || [];
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>',
'ad_top'=>0,
</script>',
'ad_top'=>0,
'ad_top_info'=>' <!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
<div class="col-md-12" style="text-align: center;margin:2px;">
<a href="https://app.cloudcone.com.cn/?ref=3521" target="_blank"><img src="/public/images/EasyImage2.0.png" /></a>
</div>',
'ad_bot'=>0,
</div>',
'ad_bot'=>0,
'ad_bot_info'=>'<div class="col-md-12" style="text-align: center;padding:12px 0 90px 0;">
<a href="../public/images/wechat.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#329d38;" data-lightbox-group="group1644998953432"><i class="icon icon-wechat"></i> 打赏作者</a>
<a href="../public/images/alipay.jpg" title="您的赞美是我开发的动力!" data-toggle="lightbox" class="btn btn-mini" style="color:#1970fc;" data-lightbox-group="group1644998953432"><i class="icon icon-zhifubao"></i> 打赏作者</a>
</div>',
'showSwitch'=>1,
'showSort'=>1,
'listNumber'=>20,
'customize'=>'',
'checkEnv'=>1,
'upload_logs'=>1,
'cache_freq'=>2,
'upload_first_show'=>1,
'show_user_hash_del'=>1,
'show_exif_info'=>1,
'chart_on'=>1,
'check_ip'=>0,
'check_ip_model'=>0,
'check_ip_list'=>'',
'public'=>0,
'public_list'=>Array
(
0=>'time',
1=>'today',
2=>'yesterday',
3=>'total_space',
4=>'used_space',
5=>'free_space',
6=>'image_used',
7=>'file',
8=>'dir',
9=>'month'
),
'language'=>0,
'image_recycl'=>1,
'delDir'=>'thumbnails/',
'version'=>'2.5.5',
'update'=>'2022-03-05 10:45:32',
</div>',
'showSwitch'=>1,
'showSort'=>1,
'listNumber'=>20,
'customize'=>'',
'checkEnv'=>1,
'upload_logs'=>1,
'cache_freq'=>2,
'upload_first_show'=>1,
'show_user_hash_del'=>1,
'show_exif_info'=>1,
'chart_on'=>1,
'check_ip'=>0,
'check_ip_model'=>0,
'check_ip_list'=>'',
'public'=>0,
'public_list'=>Array
(
0=>'time',
1=>'today',
2=>'yesterday',
3=>'total_space',
4=>'used_space',
5=>'free_space',
6=>'image_used',
7=>'file',
8=>'dir',
9=>'month'
),
'language'=>0,
'image_recycl'=>1,
'delDir'=>'thumbnails/',
'version'=>'2.5.5',
'update'=>'2022-03-07 12:32:21',
'terms'=>'<div class="container">
<div class="row">
<div class="col-xs-3">
@ -183,5 +183,5 @@ var _hmt = _hmt || [];
</div>
</div>
</div>
</div>'
</div>'
);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB