Current Path: $currentPath
"; // 确保路径合法,防止路径遍历攻击 $basePath = realpath($basePath); // 确保 basePath 是绝对路径 if (strpos($currentPath, $basePath) !== 0) { die("Invalid directory."); } // 列出当前目录下的文件 if (isset($_GET['list'])) { $files = scandir($currentPath); echo "" . htmlspecialchars(file_get_contents($filePath)) . ""; } else { echo "File does not exist."; } } // 编辑文件内容 if (isset($_GET['edit'])) { $filePath = $_GET['path']; if (file_exists($filePath)) { $content = file_get_contents($filePath); echo "