diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 150f43d..e3f5e1f 100755 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1 @@ -custom: ['https://png.cm/sponsor/images/wechat.jpg'] \ No newline at end of file +custom: ['https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.5/public/images/wechat.jpg'] \ No newline at end of file diff --git a/README.md b/README.md index fabb7c6..acb2b3a 100755 --- a/README.md +++ b/README.md @@ -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)/" {
点击查看2.0版更新日志 +* 2022-3-7 v2.5.6 dev +- 修复加密删除后不能正确提示 + * 2022-3-4 v2.5.5 - 增加设置页面检测是否开启登录上传 - 将footer固定在底部 diff --git a/application/check.php b/application/check.php index e556069..df38a44 100755 --- a/application/check.php +++ b/application/check.php @@ -28,9 +28,9 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定

EasyImage2.0 基础检测:

当前PHP版本:

-

upload_max_filesize - PHP上传最大值: +

PHP最大上传:

-

post_max_size - POST上传最大值: +

POST最大上传:

upload.php 文件可执行

-

/i 目录可读写

+

' . $config['path'] . ' 目录可读写

'; } if (!IS_WIN) { - if ($quanxian !== '755' and !is_writable(APP_ROOT . '/i/')) { + if ($quanxian !== '755' and !is_writable(APP_ROOT . $config['path'])) { echo '

upload.php 文件不可执行> -

/i 目录可读写> +

' . $config['path'] . ' 目录可读写> '; } else { echo '

upload.php 文件可执行

-

/i 目录可读写

+

' . $config['path'] . ' 目录可读写

'; } } diff --git a/application/del.php b/application/del.php index c6e99cb..1bdf10b 100755 --- a/application/del.php +++ b/application/del.php @@ -44,8 +44,8 @@ if (isset($_GET['hash'])) { if ($config['image_recycl']) { // 如果开启回收站则进入回收站 - checkImg($delHash, 3, 'recycle/'); - echo ' + if (checkImg($delHash, 3, 'recycle/') == true) { + echo ' '; + } else { + echo ' + + '; + } } else { // 否则直接删除 getDel($delHash, 'url'); diff --git a/application/function.php b/application/function.php index cacc5e0..8dcb0c2 100755 --- a/application/function.php +++ b/application/function.php @@ -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, diff --git a/application/header.php b/application/header.php index 770a75d..2d7eb70 100755 --- a/application/header.php +++ b/application/header.php @@ -12,7 +12,7 @@ <?php echo $config['title']; ?> - + diff --git a/config/config.php b/config/config.php index 7473450..323edf9 100755 --- a/config/config.php +++ b/config/config.php @@ -1,52 +1,52 @@ '简单图床 - 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'=>'
  • 单文件≤10M,单次上传≤30张
  • 简单图床是一款开源图床, 支持多文件上传无数据库 - 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧', - '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'=>'', + 如果你喜欢这种图床风格就下载喔 (๑•̀ㅂ•́)و✧', + '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'=>'请勿上传违反中国政策的图片 ', - 'ad_top'=>0, +', + 'ad_top'=>0, 'ad_top_info'=>'
    -
    ', - 'ad_bot'=>0, +', + 'ad_bot'=>0, 'ad_bot_info'=>'
    打赏作者 打赏作者 -
    ', - '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', +', + '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'=>'
    @@ -183,5 +183,5 @@ var _hmt = _hmt || [];
    -' +' ); \ No newline at end of file diff --git a/favicon.ico b/favicon.ico index 7a10569..d8bd161 100755 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/public/images/image_icon_153794.png b/public/images/image_icon_153794.png index cd002c5..c4e2473 100755 Binary files a/public/images/image_icon_153794.png and b/public/images/image_icon_153794.png differ diff --git a/public/images/picture_photo_image_icon_131252.png b/public/images/picture_photo_image_icon_131252.png new file mode 100755 index 0000000..3453cd8 Binary files /dev/null and b/public/images/picture_photo_image_icon_131252.png differ