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

Guest upload folder will Encrypted after uploaded

上级 4b816fb2
...@@ -1995,7 +1995,7 @@ function render_list($path = '', $files = '') ...@@ -1995,7 +1995,7 @@ function render_list($path = '', $files = '')
while (strpos($html, '<!--GuestEnd-->')) $html = str_replace('<!--GuestEnd-->', '', $html); while (strpos($html, '<!--GuestEnd-->')) $html = str_replace('<!--GuestEnd-->', '', $html);
} }
if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) { if ($_SERVER['ishidden']==4) {
$tmp[1] = 'a'; $tmp[1] = 'a';
while ($tmp[1]!='') { while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--IsFileStart-->'); $tmp = splitfirst($html, '<!--IsFileStart-->');
...@@ -2010,33 +2010,52 @@ function render_list($path = '', $files = '') ...@@ -2010,33 +2010,52 @@ function render_list($path = '', $files = '')
$tmp = splitfirst($tmp[1], '<!--IsFolderEnd-->'); $tmp = splitfirst($tmp[1], '<!--IsFolderEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
while (strpos($html, '<!--EncryptedStart-->')) { /*$tmp[1] = 'a';
$tmp = splitfirst($html, '<!--EncryptedStart-->'); while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--ListStart-->');
$html = $tmp[0]; $html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--EncryptedEnd-->'); $tmp = splitfirst($tmp[1], '<!--ListEnd-->');
$html .= $tmp[1];
}*/
$tmp[1] = 'a';
while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--IsNotHiddenStart-->');
$html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--IsNotHiddenEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
while (strpos($html, '<!--GuestUploadStart-->')) { while (strpos($html, '<!--EncryptedStart-->')) {
$html = str_replace('<!--GuestUploadStart-->', '', $html); $html = str_replace('<!--EncryptedStart-->', '', $html);
$html = str_replace('<!--GuestUploadEnd-->', '', $html); $html = str_replace('<!--EncryptedEnd-->', '', $html);
}
}
if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) {
while (strpos($html, '<!--UploadJsStart-->')) {
while (strpos($html, '<!--UploadJsStart-->')) $html = str_replace('<!--UploadJsStart-->', '', $html);
while (strpos($html, '<!--UploadJsEnd-->')) $html = str_replace('<!--UploadJsEnd-->', '', $html);
while (strpos($html, '<!--constStr@Calculate-->')) $html = str_replace('<!--constStr@Calculate-->', getconstStr('Calculate'), $html);
} }
} else {
$tmp[1] = 'a'; $tmp[1] = 'a';
while ($tmp[1]!='') { while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--UploadJsStart-->'); $tmp = splitfirst($html, '<!--GuestUploadStart-->');
$html = $tmp[0]; $html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--UploadJsEnd-->'); $tmp = splitfirst($tmp[1], '<!--GuestUploadEnd-->');
$html .= $tmp[1];
}
while (strpos($html, '<!--IsNotHiddenStart-->')) {
$tmp = splitfirst($html, '<!--IsNotHiddenStart-->');
$html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--IsNotHiddenEnd-->');
$html .= $tmp[1];
}
} else {
while (strpos($html, '<!--EncryptedStart-->')) {
$tmp = splitfirst($html, '<!--EncryptedStart-->');
$html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--EncryptedEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
while (strpos($html, '<!--IsNotHiddenStart-->')) {
$html = str_replace('<!--IsNotHiddenStart-->', '', $html);
$html = str_replace('<!--IsNotHiddenEnd-->', '', $html);
}
} }
if ($_SERVER['ishidden']==4) { while (strpos($html, '<!--constStr@Download-->')) $html = str_replace('<!--constStr@Download-->', getconstStr('Download'), $html);
if ($_SERVER['is_guestup_path']&&!$_SERVER['admin']) {
$tmp[1] = 'a'; $tmp[1] = 'a';
while ($tmp[1]!='') { while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--IsFileStart-->'); $tmp = splitfirst($html, '<!--IsFileStart-->');
...@@ -2051,33 +2070,43 @@ function render_list($path = '', $files = '') ...@@ -2051,33 +2070,43 @@ function render_list($path = '', $files = '')
$tmp = splitfirst($tmp[1], '<!--IsFolderEnd-->'); $tmp = splitfirst($tmp[1], '<!--IsFolderEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
/*$tmp[1] = 'a'; while (strpos($html, '<!--GuestUploadStart-->')) {
while ($tmp[1]!='') { $html = str_replace('<!--GuestUploadStart-->', '', $html);
$tmp = splitfirst($html, '<!--ListStart-->'); $html = str_replace('<!--GuestUploadEnd-->', '', $html);
$html = $tmp[0]; }
$tmp = splitfirst($tmp[1], '<!--ListEnd-->'); while (strpos($html, '<!--IsNotHiddenStart-->')) {
$html .= $tmp[1];
}*/
$tmp[1] = 'a';
while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--IsNotHiddenStart-->'); $tmp = splitfirst($html, '<!--IsNotHiddenStart-->');
$html = $tmp[0]; $html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--IsNotHiddenEnd-->'); $tmp = splitfirst($tmp[1], '<!--IsNotHiddenEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
while (strpos($html, '<!--EncryptedStart-->')) { } else {
$html = str_replace('<!--EncryptedStart-->', '', $html); while (strpos($html, '<!--GuestUploadStart-->')) {
$html = str_replace('<!--EncryptedEnd-->', '', $html); $tmp = splitfirst($html, '<!--GuestUploadStart-->');
$html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--GuestUploadEnd-->');
$html .= $tmp[1];
}
while (strpos($html, '<!--IsNotHiddenStart-->')) {
$html = str_replace('<!--IsNotHiddenStart-->', '', $html);
$html = str_replace('<!--IsNotHiddenEnd-->', '', $html);
}
}
if ($_SERVER['is_guestup_path']||( $_SERVER['admin']&&isset($files['folder'])&&$_SERVER['ishidden']<4 )) {
while (strpos($html, '<!--UploadJsStart-->')) {
while (strpos($html, '<!--UploadJsStart-->')) $html = str_replace('<!--UploadJsStart-->', '', $html);
while (strpos($html, '<!--UploadJsEnd-->')) $html = str_replace('<!--UploadJsEnd-->', '', $html);
while (strpos($html, '<!--constStr@Calculate-->')) $html = str_replace('<!--constStr@Calculate-->', getconstStr('Calculate'), $html);
} }
} else {
$tmp[1] = 'a'; $tmp[1] = 'a';
while ($tmp[1]!='') { while ($tmp[1]!='') {
$tmp = splitfirst($html, '<!--GuestUploadStart-->'); $tmp = splitfirst($html, '<!--UploadJsStart-->');
$html = $tmp[0]; $html = $tmp[0];
$tmp = splitfirst($tmp[1], '<!--GuestUploadEnd-->'); $tmp = splitfirst($tmp[1], '<!--UploadJsEnd-->');
$html .= $tmp[1]; $html .= $tmp[1];
} }
} }
while (strpos($html, '<!--constStr@Download-->')) $html = str_replace('<!--constStr@Download-->', getconstStr('Download'), $html);
if (isset($files['children'])) { if (isset($files['children'])) {
while (strpos($html, '<!--GuestUploadStart-->')) { while (strpos($html, '<!--GuestUploadStart-->')) {
...@@ -2613,10 +2642,12 @@ function render_list($path = '', $files = '') ...@@ -2613,10 +2642,12 @@ function render_list($path = '', $files = '')
// 最后清除换行 // 最后清除换行
while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html); while (strpos($html, "\r\n\r\n")) $html = str_replace("\r\n\r\n", "\r\n", $html);
//while (strpos($html, "\r\r")) $html = str_replace("\r\r", "\r", $html);
while (strpos($html, "\n\n")) $html = str_replace("\n\n", "\n", $html);
//while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html); //while (strpos($html, PHP_EOL.PHP_EOL)) $html = str_replace(PHP_EOL.PHP_EOL, PHP_EOL, $html);
$exetime = round(microtime(true)-$_SERVER['php_starttime'],3); $exetime = round(microtime(true)-$_SERVER['php_starttime'],3);
$html = str_replace('<!--FootStr-->', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html); $html = str_replace('<!--FootStr-->', date("Y-m-d H:i:s")." ".getconstStr('Week')[date("w")]." ".$_SERVER['REMOTE_ADDR'].' Runningtime:'.$exetime.'s Mem:'.size_format(memory_get_usage()), $html);
} }
$theme_arr = scandir('theme'); $theme_arr = scandir('theme');
...@@ -2632,7 +2663,7 @@ function render_list($path = '', $files = '') ...@@ -2632,7 +2663,7 @@ function render_list($path = '', $files = '')
//if ($tmp!='') $html .= ' //if ($tmp!='') $html .= '
// <option value="" '.($tmp==$theme?'selected="selected"':'').'>customTheme</option>'; // <option value="" '.($tmp==$theme?'selected="selected"':'').'>customTheme</option>';
$html .= ' $html .= '
</select> </select>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
function changetheme(str) function changetheme(str)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册