fix: ?login can return loginpage

pull/538/head
qkqpttgf 2022-01-30 15:55:54 +08:00 committed by GitHub
parent 29840c8b26
commit 4073323d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 16 deletions

View File

@ -190,7 +190,8 @@ function main($path)
} else { } else {
$adminloginpage = getConfig('adminloginpage'); $adminloginpage = getConfig('adminloginpage');
} }
if (isset($_GET['login'])&&$_GET['login']==$adminloginpage) { if (isset($_GET['login'])) {
if ($_GET['login']===$adminloginpage) {
/*if (isset($_GET['preview'])) { /*if (isset($_GET['preview'])) {
$url = $_SERVER['PHP_SELF'] . '?preview'; $url = $_SERVER['PHP_SELF'] . '?preview';
} else { } else {
@ -207,6 +208,7 @@ function main($path)
} else return adminform($compareresult); } else return adminform($compareresult);
} else return adminform(); } else return adminform();
} }
}
if ( isset($_COOKIE['admin'])&&compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin']) ) { if ( isset($_COOKIE['admin'])&&compareadminmd5('admin', getConfig('admin'), $_COOKIE['admin']) ) {
$_SERVER['admin']=1; $_SERVER['admin']=1;
$_SERVER['needUpdate'] = needUpdate(); $_SERVER['needUpdate'] = needUpdate();