fix bug: read big file by mistake, not need

pull/54/head
qkqpttgf 2020-05-04 12:58:31 +08:00 committed by GitHub
parent 94ab3fec4c
commit 88dfcd00dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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('<!--constStr@ClicktoEdit-->', getconstStr('ClicktoEdit'), $html);
$html = str_replace('<!--constStr@CancelEdit-->', getconstStr('CancelEdit'), $html);
$html = str_replace('<!--constStr@Save-->', getconstStr('Save'), $html);
$html = str_replace('<!--TxtContent-->', htmlspecialchars(curl_request($files[$_SERVER['DownurlStrName']])['body']), $html);
while (strpos($html, '<!--TxtContent-->')) $html = str_replace('<!--TxtContent-->', htmlspecialchars(curl_request($files[$_SERVER['DownurlStrName']])['body']), $html);
$html = str_replace('<!--constStr@FileNotSupport-->', getconstStr('FileNotSupport'), $html);