未验证 提交 2aec731a 编写于 作者: Q qkqpttgf 提交者: GitHub

try fix #% in file name

上级 d42547bd
......@@ -692,6 +692,7 @@ function comppass($pass)
function encode_str_replace($str)
{
$str = str_replace('%','%25',$str);
$str = str_replace('&','&',$str);
$str = str_replace('+','%2B',$str);
$str = str_replace('#','%23',$str);
......@@ -2037,7 +2038,8 @@ function render_list($path = '', $files = [])
if ($_SERVER['admin'] or !isHideFile($file['name'])) {
$filenum++;
$ext = strtolower(substr($file['name'], strrpos($file['name'], '.') + 1));
$FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderList);
$FolderListStr = $FolderList;
while (strpos($FolderListStr, '<!--FileEncodeReplaceUrl-->')) $FolderListStr = str_replace('<!--FileEncodeReplaceUrl-->', path_format($_SERVER['base_disk_path'] . '/' . $path . '/' . encode_str_replace($file['name'])), $FolderListStr);
$FolderListStr = str_replace('<!--FileExt-->', $ext, $FolderListStr);
if (in_array($ext, $exts['music'])) $FolderListStr = str_replace('<!--FileExtType-->', 'audio', $FolderListStr);
elseif (in_array($ext, $exts['video'])) $FolderListStr = str_replace('<!--FileExtType-->', 'iframe', $FolderListStr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册