diff --git a/admin/index.php b/admin/index.php
index 5128c95..1c8d3ee 100755
--- a/admin/index.php
+++ b/admin/index.php
@@ -5,8 +5,6 @@
require_once __DIR__ . '/../application/function.php';
require_once APP_ROOT . '/application/header.php';
require_once APP_ROOT . '/config/config.guest.php';
-// 验证登录
-header("Content-Type: text/html;charset=utf-8");
// 退出
if (isset($_GET['login'])) {
@@ -41,27 +39,35 @@ if (isset($_GET['login'])) {
exit(require_once APP_ROOT . '/application/footer.php');
}
-// 验证码
-if ($config['captcha']) {
- if (isset($_REQUEST['code'])) {
- session_start();
- if (strtolower($_REQUEST['code']) !== $_SESSION['code']) {
- echo '
- ';
-
- exit(require_once APP_ROOT . '/application/footer.php');
- }
- }
-}
-
// 提交登录
if (isset($_POST['password']) and isset($_POST['user'])) {
+ // 验证码
+ if ($config['captcha']) {
+ if (empty($_REQUEST['code'])) {
+ echo '
+ ';
+ exit(require_once APP_ROOT . '/application/footer.php');
+ } else {
+ session_start();
+ if (strtolower($_REQUEST['code']) !== $_SESSION['code']) {
+ echo '
+ ';
+ exit(require_once APP_ROOT . '/application/footer.php');
+ }
+ }
+ }
+
$login = _login($_POST['user'], $_POST['password']);
$login = json_decode($login, true);
diff --git a/docs/update.md b/docs/update.md
index 77f0975..30d99c3 100644
--- a/docs/update.md
+++ b/docs/update.md
@@ -1,11 +1,13 @@
* 2023-03-04 v2.7.6 dev
- 增加删除文件时限定目录
-- 增加对SVG文件格式过滤 致谢:[xulei1112](https://github.com/xulei1112)
-- 修复弱类型验证导致的异常登录 致谢:[xulei1112](https://github.com/xulei1112)
+- 增加对SVG文件格式过滤
+- 修复弱类型验证导致的异常登录
+- 修复开启验证码后登录绕过
- 更换加密删除链接算法 - 链接更短
- 更换存储密码算法为SHA256
- 默认不支持SVG文件上传
- 完全兼容 PHP5.6-8.0
+- 本次漏洞修复和代码增强感谢 [xulei1112](https://github.com/xulei1112)
* 2023-02-24 v2.7.5
- 增加定时删除文件