diff --git a/README.md b/README.md
index 46dcc5b..1a374c6 100755
--- a/README.md
+++ b/README.md
@@ -94,7 +94,7 @@ $HTTP["url"] =~ "^/(i|public)/" {
fastcgi.server = ()
}
```
- - 或者参考:[https://blog.png.cm/981.html](https://blog.png.cm/981.html)
+ - 或者参考:[https://blog.png.cm/996.html](https://blog.png.cm/996.html)
点击查看2.0版更新日志
@@ -252,7 +252,7 @@ RewriteRule config/(.*).(php)$ – [F]
deny all;
}
```
-- - 或者参考:https://blog.png.cm/992.html https://blog.png.cm/939.html
+- - 或者参考:https://blog.png.cm/939.html
- 一些精简
* 2021-4-14 v2.0.2.1 Dev1
diff --git a/application/function.php b/application/function.php
index 532dc1b..193d26e 100755
--- a/application/function.php
+++ b/application/function.php
@@ -464,8 +464,8 @@ function is_who_login($user)
function checkEnv($mode)
{
// 初始化安装
- if (!file_exists(APP_ROOT . '/install/install.lock') and file_exists(APP_ROOT . '/install/install.php')) {
- exit('');
+ if (!is_file(APP_ROOT . '/install/install.lock') and is_file(APP_ROOT . '/install/install.php')) {
+ echo '';
}
if ($mode) {
@@ -644,12 +644,24 @@ function re_checkImg($name)
{
global $config;
- $fileToPath = str_replace('_', '/', $name); // 将图片名称还原为带路径的名称,eg:2021_11_03_pbmn1a.jpg =>2021/11/03/pbmn1a.jpg
+ $fileToPath = str_replace('_', '/', $name); // 将图片名称还原为带路径的名称,eg:2021_11_03_pbmn1a.jpg =>2021/11/03/pbmn1a.jpg
$now_path_file = APP_ROOT . $config['path'] . 'suspic/' . $name; // 当前图片绝对位置 */i/suspic/2021_10_30_p8vypd.png
- $to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
- rename($now_path_file, $to_file);
+ if (is_file($now_path_file)) {
+ $to_file = APP_ROOT . $config['path'] . $fileToPath; // 要还原图片的绝对位置 */i/2021/10/30/p8vypd.png
+ rename($now_path_file, $to_file); // 移动文件
+ } else {
+ echo "
+
+ ";
+ }
}
+
/**
* 创建缩略图
* @param $imgName string 需要创建缩略图的名称
diff --git a/config/config.php b/config/config.php
index 7e5b308..41e558e 100755
--- a/config/config.php
+++ b/config/config.php
@@ -1,4 +1,4 @@
-'简单图床 - EasyImage',
@@ -80,5 +80,5 @@ $config=Array
'check_ip_model'=>0,
'check_ip_list'=>'',
'version'=>'2.4.7',
- 'form'=>'2022-01-27 17:20:14'
+ 'form'=>'2022-01-28 21:21:52'
);
\ No newline at end of file
diff --git a/file.php b/file.php
index 089343b..a024d0a 100755
--- a/file.php
+++ b/file.php
@@ -7,7 +7,6 @@ require APP_ROOT . '/application/WaterMask.php';
// 检查登录
if ($config['mustLogin']) {
checkLogin();
- exit;
}
// 黑/白IP名单上传
diff --git a/install/contorl.php b/install/contorl.php
index 9cab5bf..dc5a0eb 100755
--- a/install/contorl.php
+++ b/install/contorl.php
@@ -12,7 +12,7 @@ if (isset($_POST['password'])) {
$config['user'] = $_POST['user'];
} else {
- exit('');
+ exit('');
}
}
@@ -32,7 +32,7 @@ file_put_contents(APP_ROOT . '/install/install.lock', '安装程序锁定文件
// 删除安装目录
if (isset($_POST['del_install'])) {
if ($_POST['del_install'] == "del") {
- deldir(APP_ROOT . "/install/");
+ deldir(APP_ROOT . "/install");
}
}
@@ -43,15 +43,15 @@ if (isset($_POST['del_extra_files'])) {
@unlink(APP_ROOT . '/LICENSE');
@unlink(APP_ROOT . '/README.md');
@unlink(APP_ROOT . '/config/EasyIamge.lock');
- @deldir(APP_ROOT . "/.github/");
- @deldir(APP_ROOT . "/.git/");
+ @deldir(APP_ROOT . "/.github");
+ @deldir(APP_ROOT . "/.git");
}
}
// 跳转主页
echo '
';
diff --git a/install/index.php b/install/index.php
index 1d7801e..d29fd7c 100755
--- a/install/index.php
+++ b/install/index.php
@@ -27,6 +27,8 @@ if (!IS_WIN) {
}
}
+$userINI = is_file(APP_ROOT . '/.user.ini') ? false : true; // user.ini
+
function checkPASS($name)
{
if ($name) {
@@ -49,12 +51,13 @@ function checkPASS($name)
+
+
-
@@ -98,14 +101,17 @@ function checkPASS($name)
可写
-
-
+
+
如果你的PHP版本较低或者不想安装上述PHP扩展请删除.user.ini
+ 防止跨目录访问和读取文件->删除方法
+
+ install
目录