fix: & in path cause readme bug, admin now not need folder passwd

pull/128/head
qkqpttgf 2020-09-18 11:10:49 +08:00 committed by GitHub
parent ab1ceefdeb
commit 4b3c3a9407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -718,6 +718,7 @@ function spurlencode($str, $split='')
$tmp = urlencode($str); $tmp = urlencode($str);
} }
$tmp = str_replace('%2520', '%20',$tmp); $tmp = str_replace('%2520', '%20',$tmp);
$tmp = str_replace('%26amp%3B', '&',$tmp);
return $tmp; return $tmp;
} }
@ -971,6 +972,7 @@ function output($body, $statusCode = 200, $headers = ['Content-Type' => 'text/ht
function passhidden($path) function passhidden($path)
{ {
if ($_SERVER['admin']) return 0;
$path = str_replace('+','%2B',$path); $path = str_replace('+','%2B',$path);
$path = str_replace('&','&', path_format(urldecode($path))); $path = str_replace('&','&', path_format(urldecode($path)));
if (getConfig('passfile') != '') { if (getConfig('passfile') != '') {