Merge pull request #69 from qkqpttgf/master

pull/98/head
Mr.Lin 2020-04-09 20:23:52 +08:00 committed by GitHub
commit 379b6fca3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -190,7 +190,7 @@ function main($path)
}
}
if (getConfig('admin')!='')
if ( (isset($_COOKIE['admin'])&&$_COOKIE['admin']==md5(getConfig('admin'))) || (isset($_POST['password1'])&&$_POST['password1']==getConfig('admin')) ) {
if ( isset($_COOKIE['admin'])&&$_COOKIE['admin']==md5(getConfig('admin')) ) {
$_SERVER['admin']=1;
$_SERVER['needUpdate'] = needUpdate();
} else {
@ -1252,7 +1252,7 @@ function render_list($path = '', $files = '')
global $constStr;
if (isset($files['children']['index.html']) && !$_SERVER['admin']) {
$htmlcontent = fetch_files(spurlencode(path_format($path . '/index.html'),'/'))['content'];
$htmlcontent = fetch_files(spurlencode(path_format(urldecode($path) . '/index.html'),'/'))['content'];
return output($htmlcontent['body'], $htmlcontent['stat']);
}
$path = str_replace('%20','%2520',$path);