pull/141/head
= 2022-02-13 16:14:46 +08:00
parent dc83ee7adc
commit 77999a704e
11 changed files with 73 additions and 77 deletions

View File

@ -103,6 +103,17 @@ $HTTP["url"] =~ "^/(i|public)/" {
<details><summary><mark>点击查看2.0版更新日志</mark></summary>
* 2022-2-13 v2.5.1
- 异步执行鉴黄
- 取消检测imagick扩展
- 修复可能导致检测弹窗弹出失败
* 2022-2-7 v2.5.0
- 修复静态文件调用失败
* 2022-2-6 v2.4.9
- 修复静态文件引用
* 2022-2-6 v2.4.9
- 修复flash和silverlight路径引用(>IE9不影响)
- markdown html alt值改为源文件名

View File

@ -87,13 +87,12 @@ if ($handle->uploaded) {
/** 后续处理 */
require APP_ROOT . '/application/process.php';
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 使用fastcgi_finish_request操作
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 日志
if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size);
// 水印
@ -101,6 +100,8 @@ if ($handle->uploaded) {
// 压缩
@compress($handle->file_dst_pathname);
} else {
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 日志
if ($config['upload_logs']) write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size);
// 水印
@ -108,5 +109,6 @@ if ($handle->uploaded) {
// 压缩
@compress($handle->file_dst_pathname);
}
unset($handle);
}

View File

@ -1,5 +1,6 @@
<?php
require_once __DIR__ . '/function.php';
require_once __DIR__ . '/total_files.php';
/**
* 统计最近一个月上传文件数与空间占用

View File

@ -1,15 +1,14 @@
<?php
require_once __DIR__ . '/function.php';
// global $config;
// 跳转安装
if (!is_file(APP_ROOT . '/install/install.lock') and is_file(APP_ROOT . '/install/install.php')) {
echo '<script type="text/javascript">window.location.href="' . get_whole_url('/') . '/install/index.php"</script>';
exit('<script type="text/javascript">window.location.href="' . get_whole_url('/') . '/install/index.php"</script>');
}
/**
* 检测弹窗内容
*/
if (is_file(APP_ROOT . '/config/EasyIamge.lock')) return; // 查询锁定弹窗文件是否存在
if (file_exists(APP_ROOT . '/config/EasyIamge.lock')) return; // 查询锁定弹窗文件是否存在
file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定文件,如需再次展示请删除此文件!', FILE_APPEND | LOCK_EX);
?>
<div class="modal fade" id="myModal-1">
@ -34,8 +33,8 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定
<p>post_max_size - POST上传最大值:<sapn style="color:green"><?php echo ini_get('post_max_size'); ?></sapn>
</p>
<?php
// 扩展检测
$expand = array('fileinfo', 'gd', 'openssl', 'imagick');
// 扩展检测 取消检测imagick扩展
$expand = array('fileinfo', 'gd', 'openssl');
foreach ($expand as $val) {
if (extension_loaded($val)) {
echo '
@ -46,7 +45,7 @@ file_put_contents(APP_ROOT . '/config/EasyIamge.lock', '安装环境检测锁定
}
}
// 文件权限检测
$quanxian = substr(base_convert(fileperms("./application/upload.php"), 10, 8), 3);
$quanxian = substr(base_convert(fileperms(APP_ROOT . "/application/upload.php"), 10, 8), 3);
if (IS_WIN) {
echo '
<p style="color:green">upload.php 文件可执行</p>

View File

@ -1,4 +1,4 @@
<?php if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
<?php if ($config['ad_bot']) echo $config['ad_bot_info']; // 底部广告
?>
<footer class="text-muted small col-md-12" style="text-align: center;">
<hr>
@ -28,7 +28,6 @@
<!-- 二维码对话框触发按钮 -->
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal" title="使用手机扫描二维码访问"><i class="icon icon-qrcode hidden-xs inline-block"></i></a>
<?php
// 登录与退出
if (is_who_login('admin') || is_who_login('guest')) {
echo '<a href="' . $config['domain'] . '/admin/index.php?login=logout" title="退出账号"><i class="icon icon-signout"></i></a>';
@ -38,9 +37,6 @@
?>
</p>
</footer>
<?php /** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php'; ?>
<script>
// 导航状态
$('.nav-pills').find('a').each(function() {
@ -48,7 +44,7 @@
$(this).parent().addClass('active'); // this.className = 'active';
}
});
// js 获取当前网址二维码
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: window.location.href,
@ -67,6 +63,7 @@
console.log("%cEasyImage2.0", "background: rgba(252,234,187,1);background: -moz-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%,rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -webkit-gradient(left top, right top, color-stop(0%, rgba(252,234,187,1)), color-stop(12%, rgba(175,250,77,1)), color-stop(28%, rgba(0,247,49,1)), color-stop(39%, rgba(0,210,247,1)), color-stop(51%, rgba(0,189,247,1)), color-stop(64%, rgba(133,108,217,1)), color-stop(78%, rgba(177,0,247,1)), color-stop(87%, rgba(247,0,189,1)), color-stop(100%, rgba(245,22,52,1)));background: -webkit-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -o-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: -ms-linear-gradient(left, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);background: linear-gradient(to right, rgba(252,234,187,1) 0%, rgba(175,250,77,1) 12%, rgba(0,247,49,1) 28%, rgba(0,210,247,1) 39%, rgba(0,189,247,1) 51%, rgba(133,108,217,1) 64%, rgba(177,0,247,1) 78%, rgba(247,0,189,1) 87%, rgba(245,22,52,1) 100%);filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fceabb', endColorstr='#f51634', GradientType=1 );font-size:2.34em;font-weight:bold")
console.log('%c图床演示网站: https://png.cm \n请为本人博客 https://blog.png.cm/ 加上链接, 谢谢尊重!\n作为开发者你可以对相应的后台功能进行扩展(增删改相应代码), 但请保留代码中相关来源信息(例如: 本人博客, 邮箱等);\n本程序由 Icret 独自开发并完全开源, 碰到收费发布的请不要轻易付款; 本人仅为程序开源创作, 如非法网站使用与本人无关, 请勿用于非法用途.%c ', 'color: #eaad1a; padding:5px 0; border:1px solid #448ef6; font-size:12px;', '');
</script>
<?php /** 环境检测 */ if ($config['checkEnv']) require_once APP_ROOT . '/application/check.php'; ?>
</body>
</html>

View File

@ -1,6 +1,5 @@
<?php
require_once __DIR__ . '/function.php';
require_once APP_ROOT . '/application/total_files.php';
?>
<!DOCTYPE html>
<html lang="zh-cn">
@ -40,25 +39,18 @@ require_once APP_ROOT . '/application/total_files.php';
<?php if ($config['ad_top']) echo $config['ad_top_info']; ?>
<div class="page-header">
<ul class="nav nav-pills">
<li>
<a href="<?php echo $config['domain']; ?>"><i class="icon icon-home"></i> 首页</a>
</li>
<li><a href="<?php echo $config['domain']; ?>"><i class="icon icon-home"></i> 首页</a></li>
<?php
// 关闭广场非登录状态不显示广场导航
if ($config['showSwitch'] || is_who_login('admin')) echo '
<li>
<a href="' . $config['domain'] . '/application/list.php"><i class="icon icon-th"></i> 广场<span class="label label-badge label-success">' . get_file_by_glob(APP_ROOT . config_path(), 'number') . '</span></a>
</li>';
<li><a href="' . $config['domain'] . '/application/list.php"><i class="icon icon-th"></i> 广场<span class="label label-badge label-success">' . get_file_by_glob(APP_ROOT . config_path(), 'number') . '</span></a></li>';
// 登陆状态显示设置页面
if (is_who_login('admin')) {
echo '
<li>
<a href="' . $config['domain'] . '/admin/admin.inc.php' . '"><i class="icon icon-cogs"></i> 设置</a>
</li>';
<li><a href="' . $config['domain'] . '/admin/admin.inc.php' . '"><i class="icon icon-cogs"></i> 设置</a></li>';
// 登陆状态下开启统计页面与导航
if ($config['chart_on']) echo '
<li>
<a href="' . $config['domain'] . '/admin/chart.php' . '"><i class="icon icon-pie-chart"></i> 统计</a>
<li><a href="' . $config['domain'] . '/admin/chart.php' . '"><i class="icon icon-pie-chart"></i> 统计</a>
</li>';
} ?>

View File

@ -101,7 +101,6 @@ if ($handle->uploaded) {
exit(json_encode($reJson, JSON_UNESCAPED_UNICODE));
}
/** 后续处理 */
require __DIR__ . '/process.php';
/*
@ -116,12 +115,11 @@ if ($handle->uploaded) {
@request_asynchronous('/application/process.php', 'GET', $process, $config['domain']);
}
*/
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 使用fastcgi_finish_request操作
if (function_exists('fastcgi_finish_request')) {
fastcgi_finish_request();
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 日志
if ($config['upload_logs']) @write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size);
// 水印
@ -129,6 +127,8 @@ if ($handle->uploaded) {
// 压缩
@compress($handle->file_dst_pathname);
} else {
// 普通模式鉴黄
@process_checkImg($imageUrl);
// 日志
if ($config['upload_logs']) write_log($pathIMG, $handle->file_src_name, $handle->file_dst_pathname, $handle->file_src_size);
// 水印
@ -137,6 +137,5 @@ if ($handle->uploaded) {
@compress($handle->file_dst_pathname);
}
unset($handle);
}

View File

@ -1,11 +1,11 @@
<?php
<?php
$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>
'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',
@ -17,11 +17,11 @@ $config=Array
'imgName'=>'default',
'maxSize'=>10485760,
'maxUploadFiles'=>30,
'watermark'=>0,
'waterText'=>'简单图床 - ww.png.cm',
'watermark'=>1,
'waterText'=>'简单图床 - png.cm',
'waterPosition'=>0,
'textColor'=>'255,0,0,1',
'textSize'=>20,
'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',
@ -41,32 +41,31 @@ $config=Array
'imgRatio_preserve_headers'=>1,
'static_cdn'=>0,
'theme'=>'default',
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.0',
'TinyPng_key'=>'',
'checkImg'=>0,
'checkImg_value'=>50,
'moderatecontent_key'=>'',
'nsfwjs_url'=>'',
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?c790ac2bdc2f385757ecd0183206108d";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
',
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?c790ac2bdc2f385757ecd0183206108d";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</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>
'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,
'ad_bot_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>
'ad_bot_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>',
'showSwitch'=>1,
'listNumber'=>20,
@ -81,6 +80,6 @@ var _hmt = _hmt || [];
'check_ip'=>0,
'check_ip_model'=>0,
'check_ip_list'=>'',
'version'=>'2.4.9',
'form'=>'2022-02-07 06:34:43'
'version'=>'2.5.1',
'form'=>'2022-02-13 16:06:20'
);

View File

@ -1,21 +1,17 @@
<?php
require_once 'application/header.php';
// 公告
if (!empty($config['tips'])) echo '
<div class="marquee">
<div class="wrap">
<div id="marquee2">
' . $config['tips'] . '
</div>
</div>
</div>
';
// 检查登录
mustLogin();
?>
<div class="col-md-12">
<!-- 公告 -->
<div class="marquee">
<div class="wrap">
<div id="marquee2">
<?php if (!empty($config['tips'])) echo $config['tips']; ?>
</div>
</div>
</div>
<div id='upShowID' class="uploader col-md-10 col-md-offset-1 clo-xs-12" data-ride="uploader" data-url="/application/upload.php">
<div class="uploader-message text-center">
<div class="content"></div>

View File

@ -38,12 +38,12 @@ if (isset($_POST['del_install'])) {
// 删除多余文件.whitesource
if (isset($_POST['del_extra_files'])) {
if ($_POST['del_extra_files'] == "del") {
if ($_POST['del_extra_files'] == "del") {
@unlink(APP_ROOT . '/LICENSE');
@unlink(APP_ROOT . '/README.md');
@unlink(APP_ROOT . '/.whitesource');
@unlink(APP_ROOT . '/CODE_OF_CONDUCT.md');
@unlink(APP_ROOT . '/config/EasyIamge.lock');
@unlink(APP_ROOT . '/.whitesource');
@unlink(APP_ROOT . '/CODE_OF_CONDUCT.md');
@unlink(APP_ROOT . '/config/EasyIamge.lock');
@deldir(APP_ROOT . "/.github");
@deldir(APP_ROOT . "/.git");
}
@ -52,7 +52,7 @@ if (isset($_POST['del_extra_files'])) {
// 跳转主页
echo '
<script>
window.alert("安装成功即将为您跳转到登陆界面!");
location.href="../index.php";
window.alert("安装成功,即将为您跳转到登陆界面!");
location.href="../admin/index.php";
</script>
';

View File

@ -109,7 +109,7 @@ if ($state !== 'checked') {
password.onblur = function() {
if (this.value.length < 8 || this.value.length > 18) {
message.innerHTML = '密码长度错误应为8~18位';
message.innerHTML = '密码长度错误,应为8~18位';
message.className = 'message wrong';
} else {
message.innerHTML = '密码长度正确';