From 938d7cfda11e8b91379f16c495f4d70324947c4f Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 12 May 2020 14:13:46 +0800 Subject: [PATCH] fix: output guest upload in encrypted folder --- common.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/common.php b/common.php index 2ae7073..e29c121 100644 --- a/common.php +++ b/common.php @@ -1879,7 +1879,7 @@ function render_list($path = '', $files = '') $html = str_replace('', '', $html); } } - if ($_SERVER['is_guestup_path']||$_SERVER['admin']) { + if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) { while (strpos($html, '')) { $html = str_replace('', '', $html); $html = str_replace('', '', $html); @@ -1926,10 +1926,13 @@ function render_list($path = '', $files = '') $html = str_replace('', '', $html); $html = str_replace('', '', $html); } - /*while (strpos($html, '')) { - $html = str_replace('', '', $html); - $html = str_replace('', '', $html); - }*/ + $tmp[1] = 'a'; + while ($tmp[1]!='') { + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + $html .= $tmp[1]; + } } if (isset($files['children'])) { @@ -2162,9 +2165,7 @@ function render_list($path = '', $files = '') while (strpos($html, '')) $html = str_replace('', $_SERVER['base_path'], $html); while (strpos($html, '')) $html = str_replace('', str_replace('%23', '#', str_replace('&','&', $path)), $html); while (strpos($html, '')) $html = str_replace('', getconstStr('Home'), $html); - - while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html); - + $html = str_replace('', getConfig('customCss'), $html); $html = str_replace('', getConfig('customScript'), $html); @@ -2404,6 +2405,12 @@ function render_list($path = '', $files = '') } $html .= $tmp[1]; + $tmp = splitfirst($html, ''); + $html = $tmp[0]; + $tmp = splitfirst($tmp[1], ''); + if (!isset($_COOKIE['timezone'])) $html .= str_replace('', $_SERVER['timezone'], $tmp[0]); + $html .= $tmp[1]; + while (strpos($html, '')) $html = str_replace('', $_SERVER['timezone'], $html); // 最后清除换行 while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html);