try fix #% in file name
parent
d42547bdfb
commit
2aec731ab1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue