From 88dfcd00dcbee1ca5758f52f567365b4494dd393 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 4 May 2020 12:58:31 +0800 Subject: [PATCH] fix bug: read big file by mistake, not need --- common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common.php b/common.php index 511e98a..a31e5ba 100644 --- a/common.php +++ b/common.php @@ -1699,7 +1699,8 @@ function render_list($path = '', $files = '') if (in_array($ext, $exts['img'])) $ext = 'img'; elseif (in_array($ext, $exts['video'])) $ext = 'video'; elseif (in_array($ext, $exts['music'])) $ext = 'music'; - elseif (in_array($ext, $exts['pdf'])) $ext = 'pdf'; + //elseif (in_array($ext, $exts['pdf'])) $ext = 'pdf'; + elseif ($ext=='pdf') $ext = 'pdf'; elseif (in_array($ext, $exts['office'])) $ext = 'office'; elseif (in_array($ext, $exts['txt'])) $ext = 'txt'; else $ext = 'Other'; @@ -1724,7 +1725,7 @@ function render_list($path = '', $files = '') $html = str_replace('', getconstStr('ClicktoEdit'), $html); $html = str_replace('', getconstStr('CancelEdit'), $html); $html = str_replace('', getconstStr('Save'), $html); - $html = str_replace('', htmlspecialchars(curl_request($files[$_SERVER['DownurlStrName']])['body']), $html); + while (strpos($html, '')) $html = str_replace('', htmlspecialchars(curl_request($files[$_SERVER['DownurlStrName']])['body']), $html); $html = str_replace('', getconstStr('FileNotSupport'), $html);