Merge pull request #69 from qkqpttgf/master

This commit is contained in:
Mr.Lin
2020-04-09 20:23:52 +08:00
committed by GitHub
+2 -2
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);