{"id":816,"date":"2017-11-24T10:09:24","date_gmt":"2017-11-24T19:09:24","guid":{"rendered":"\/blog\/?p=816"},"modified":"2023-09-21T09:37:41","modified_gmt":"2023-09-21T00:37:41","slug":"%ec%8b%ac%ed%94%8c-php-%ec%9b%b9-%ed%8c%8c%ec%9d%bc%ea%b4%80%eb%a6%ac%ec%9e%90","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=816","title":{"rendered":"\uc2ec\ud50c PHP \uc6f9 \ud30c\uc77c\uad00\ub9ac\uc790"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/**\n * PHP File Manager (2017-08-07)\n * https:\/\/github.com\/alexantr\/filemanager\n * \ud30c\uc77c \uc5c5\ub85c\ub4dc\/\ub9ac\ub124\uc784\/\uc0ad\uc81c \uae30\ub2a5\uc740 \uc81c\uac70\ud558\uace0 \ub2e4\uc6b4\ub85c\ub4dc\ub9cc \uac00\ub2a5\ud558\uac8c \uc218\uc815\ub41c \ubc84\uc804\uc784.\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    'admin' => 'mypass1234',\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 = 'Asia\/Seoul'; \/\/ UTC+9\n\n\/\/ Root path for file manager\n\/\/$root_path = $_SERVER['DOCUMENT_ROOT'];\n$root_path = '\/sdc1';\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 = 'UTF-8';\n\n\/\/ date() format for file modification date\n$datetime_format = 'y.m.d 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', '&lt;') &amp;&amp; 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']) &amp;&amp; ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)\n    || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &amp;&amp; $_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 \"&lt;h1>Root path \\\"{$root_path}\\\" not found!&lt;\/h1>\";\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']]) &amp;&amp; $_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        &lt;div class=\"path\">\n            &lt;form action=\"\" method=\"post\" style=\"margin:10px;text-align:center\">\n                &lt;input name=\"fm_usr\" value=\"\" placeholder=\"Username\" required>\n                &lt;input type=\"password\" name=\"fm_pwd\" value=\"\" placeholder=\"Password\" required>\n                &lt;input type=\"submit\" value=\"Login\">\n            &lt;\/form>\n        &lt;\/div>\n        &lt;?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\/\/ 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 != '' &amp;&amp; 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\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) &amp;&amp; $file != '.' &amp;&amp; $file != '..') {\n            $folders[] = $file;\n        }\n    }\n}\n\nif (!empty($files)) {\n    natcasesort($files);\n}\nif (!empty($folders)) {\n    natcasesort($folders);\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    &lt;div class=\"path\">\n        &lt;p class=\"break-word\">&lt;b>&lt;?php echo $view_title ?> \"&lt;?php echo fm_convert_win($file) ?>\"&lt;\/b>&lt;\/p>\n        &lt;p class=\"break-word\">\n            Full path: &lt;?php echo fm_convert_win($file_path) ?>&lt;br>\n            File size: &lt;?php echo fm_get_filesize($filesize) ?>&lt;?php if ($filesize >= 1000): ?> (&lt;?php echo sprintf('%s bytes', $filesize) ?>)&lt;?php endif; ?>&lt;br>\n            MIME-type: &lt;?php echo $mime_type ?>&lt;br>\n            &lt;?php\n            \/\/ ZIP info\n            if ($is_zip &amp;&amp; $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: &lt;?php echo $total_files ?>&lt;br>\n                Total size: &lt;?php echo fm_get_filesize($total_uncomp) ?>&lt;br>\n                Size in archive: &lt;?php echo fm_get_filesize($total_comp) ?>&lt;br>\n                Compression: &lt;?php echo round(($total_comp \/ $total_uncomp) * 100) ?>%&lt;br>\n                &lt;?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') . '&lt;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') . '&lt;br>';\n            }\n            ?>\n        &lt;\/p>\n        &lt;p>\n            &lt;b>&lt;a href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>&amp;amp;dl=&lt;?php echo urlencode($file) ?>\">&lt;i class=\"icon-download\">&lt;\/i> Download&lt;\/a>&lt;\/b> &amp;nbsp;\n            &lt;b>&lt;a href=\"&lt;?php echo $file_url ?>\" target=\"_blank\">&lt;i class=\"icon-chain\">&lt;\/i> Open&lt;\/a>&lt;\/b> &amp;nbsp;\n            &lt;?php\n            \/\/ ZIP actions\n            if ($is_zip &amp;&amp; $filenames !== false) {\n                $zip_name = pathinfo($file_path, PATHINFO_FILENAME);\n                ?>\n                &lt;b>&lt;a href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>&amp;amp;unzip=&lt;?php echo urlencode($file) ?>\">&lt;i class=\"icon-apply\">&lt;\/i> Unpack&lt;\/a>&lt;\/b> &amp;nbsp;\n                &lt;b>&lt;a href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>&amp;amp;unzip=&lt;?php echo urlencode($file) ?>&amp;amp;tofolder=1\" title=\"Unpack to &lt;?php echo fm_enc($zip_name) ?>\">&lt;i class=\"icon-apply\">&lt;\/i>\n                    Unpack to folder&lt;\/a>&lt;\/b> &amp;nbsp;\n                &lt;?php\n            }\n            ?>\n            &lt;b>&lt;a href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>\">&lt;i class=\"icon-goback\">&lt;\/i> Back&lt;\/a>&lt;\/b>\n        &lt;\/p>\n        &lt;?php\n        if ($is_zip) {\n            \/\/ ZIP content\n            if ($filenames !== false) {\n                echo '&lt;code class=\"maxheight\">';\n                foreach ($filenames as $fn) {\n                    if ($fn['folder']) {\n                        echo '&lt;b>' . $fn['name'] . '&lt;\/b>&lt;br>';\n                    } else {\n                        echo $fn['name'] . ' (' . fm_get_filesize($fn['filesize']) . ')&lt;br>';\n                    }\n                }\n                echo '&lt;\/code>';\n            } else {\n                echo '&lt;p>Error while fetching archive info&lt;\/p>';\n            }\n        } elseif ($is_image) {\n            \/\/ Image content\n            if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico'))) {\n                echo '&lt;p>&lt;img src=\"' . $file_url . '\" alt=\"\" class=\"preview-img\">&lt;\/p>';\n            }\n        } elseif ($is_audio) {\n            \/\/ Audio content\n            echo '&lt;p>&lt;audio src=\"' . $file_url . '\" controls preload=\"metadata\">&lt;\/audio>&lt;\/p>';\n        } elseif ($is_video) {\n            \/\/ Video content\n            echo '&lt;div class=\"preview-video\">&lt;video src=\"' . $file_url . '\" width=\"640\" height=\"360\" controls preload=\"metadata\">&lt;\/video>&lt;\/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 = '&lt;pre class=\"with-hljs\">&lt;code class=\"' . $hljs_class . '\">' . fm_enc($content) . '&lt;\/code>&lt;\/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 = '&lt;pre>' . fm_enc($content) . '&lt;\/pre>';\n            }\n            echo $content;\n        }\n        ?>\n    &lt;\/div>\n    &lt;?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&lt;form action=\"\" method=\"post\">\n&lt;input type=\"hidden\" name=\"p\" value=\"&lt;?php echo fm_enc(FM_PATH) ?>\">\n&lt;input type=\"hidden\" name=\"group\" value=\"1\">\n&lt;table>&lt;tr>\n&lt;th style=\"width:3%\">&lt;label>&lt;input type=\"checkbox\" title=\"Invert selection\" onclick=\"checkbox_toggle()\">&lt;\/label>&lt;\/th>\n&lt;th>Name&lt;\/th>&lt;th style=\"width:10%\">Size&lt;\/th>\n&lt;th style=\"width:12%\">Modified&lt;\/th>\n&lt;?php if (!FM_IS_WIN): ?>&lt;th style=\"width:6%\">Perms&lt;\/th>&lt;th style=\"width:10%\">Owner&lt;\/th>&lt;?php endif; ?>\n&lt;th style=\"width:13%\">&lt;\/th>&lt;\/tr>\n&lt;?php\n\/\/ link to parent folder\nif ($parent !== false) {\n    ?>\n&lt;tr>&lt;td>&lt;\/td>&lt;td colspan=\"&lt;?php echo !FM_IS_WIN ? '6' : '4' ?>\">&lt;a href=\"?p=&lt;?php echo urlencode($parent) ?>\">&lt;i class=\"icon-arrow_up\">&lt;\/i> ..&lt;\/a>&lt;\/td>&lt;\/tr>\n&lt;?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') &amp;&amp; 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&lt;tr>\n&lt;td>&lt;label>&lt;input type=\"checkbox\" name=\"file[]\" value=\"&lt;?php echo fm_enc($f) ?>\">&lt;\/label>&lt;\/td>\n&lt;td>&lt;div class=\"filename\">&lt;a href=\"?p=&lt;?php echo urlencode(trim(FM_PATH . '\/' . $f, '\/')) ?>\">&lt;i class=\"&lt;?php echo $img ?>\">&lt;\/i> &lt;?php echo fm_convert_win($f) ?>&lt;\/a>&lt;?php echo ($is_link ? ' &amp;rarr; &lt;i>' . readlink($path . '\/' . $f) . '&lt;\/i>' : '') ?>&lt;\/div>&lt;\/td>\n&lt;td>Folder&lt;\/td>&lt;td>&lt;?php echo $modif ?>&lt;\/td>\n&lt;?php if (!FM_IS_WIN): ?>\n&lt;td>&lt;?php echo $owner['name'] . ':' . $group['name'] ?>&lt;\/td>\n&lt;?php endif; ?>\n&lt;td>\n&lt;\/td>&lt;\/tr>\n    &lt;?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) . '&amp;amp;view=' . urlencode($f);\n    $all_files_size += $filesize_raw;\n    $perms = substr(decoct(fileperms($path . '\/' . $f)), -4);\n    if (function_exists('posix_getpwuid') &amp;&amp; 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&lt;tr>\n&lt;td>&lt;label>&lt;input type=\"checkbox\" name=\"file[]\" value=\"&lt;?php echo fm_enc($f) ?>\">&lt;\/label>&lt;\/td>\n&lt;td>&lt;div class=\"filename\">&lt;a href=\"&lt;?php echo $filelink ?>\" title=\"File info\">&lt;i class=\"&lt;?php echo $img ?>\">&lt;\/i> &lt;?php echo fm_convert_win($f) ?>&lt;\/a>&lt;?php echo ($is_link ? ' &amp;rarr; &lt;i>' . readlink($path . '\/' . $f) . '&lt;\/i>' : '') ?>&lt;\/div>&lt;\/td>\n&lt;td>&lt;span class=\"gray\" title=\"&lt;?php printf('%s bytes', $filesize_raw) ?>\">&lt;?php echo $filesize ?>&lt;\/span>&lt;\/td>\n&lt;td>&lt;?php echo $modif ?>&lt;\/td>\n&lt;?php if (!FM_IS_WIN): ?>\n&lt;td>&lt;a title=\"Change Permissions\" href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>&amp;amp;chmod=&lt;?php echo urlencode($f) ?>\">&lt;?php echo $perms ?>&lt;\/a>&lt;\/td>\n&lt;td>&lt;?php echo $owner['name'] . ':' . $group['name'] ?>&lt;\/td>\n&lt;?php endif; ?>\n&lt;td>\n&lt;a title=\"Download\" href=\"?p=&lt;?php echo urlencode(FM_PATH) ?>&amp;amp;dl=&lt;?php echo urlencode($f) ?>\">&lt;i class=\"icon-download\">&lt;\/i>&lt;\/a>\n&lt;\/td>&lt;\/tr>\n    &lt;?php\n    flush();\n}\n\nif (empty($folders) &amp;&amp; empty($files)) {\n    ?>\n&lt;tr>&lt;td>&lt;\/td>&lt;td colspan=\"&lt;?php echo !FM_IS_WIN ? '6' : '4' ?>\">&lt;em>Folder is empty&lt;\/em>&lt;\/td>&lt;\/tr>\n&lt;?php\n} else {\n    ?>\n&lt;tr>&lt;td class=\"gray\">&lt;\/td>&lt;td class=\"gray\" colspan=\"&lt;?php echo !FM_IS_WIN ? '6' : '4' ?>\">\nFull size: &lt;span title=\"&lt;?php printf('%s bytes', $all_files_size) ?>\">&lt;?php echo fm_get_filesize($all_files_size) ?>&lt;\/span>,\nfiles: &lt;?php echo $num_files ?>,\nfolders: &lt;?php echo $num_folders ?>\n&lt;\/td>&lt;\/tr>\n&lt;?php\n}\n?>\n&lt;\/table>\n&lt;p class=\"path\">&lt;a href=\"#\" onclick=\"select_all();return false;\">&lt;i class=\"icon-checkbox\">&lt;\/i> Select all&lt;\/a> &amp;nbsp;\n&lt;a href=\"#\" onclick=\"unselect_all();return false;\">&lt;i class=\"icon-checkbox_uncheck\">&lt;\/i> Unselect all&lt;\/a> &amp;nbsp;\n&lt;a href=\"#\" onclick=\"invert_all();return false;\">&lt;i class=\"icon-checkbox_invert\">&lt;\/i> Invert selection&lt;\/a>&lt;\/p>\n&lt;p>&lt;\/p>\n&lt;\/form>\n\n&lt;?php\nfm_show_footer();\n\n\/\/--- END\n\n\/\/ Functions\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 &lt; 1000) {\n        return sprintf('%s B', $size);\n    } elseif (($size \/ 1024) &lt; 1000) {\n        return sprintf('%s KiB', round(($size \/ 1024), 2));\n    } elseif (($size \/ 1024 \/ 1024) &lt; 1000) {\n        return sprintf('%s MiB', round(($size \/ 1024 \/ 1024), 2));\n    } elseif (($size \/ 1024 \/ 1024 \/ 1024) &lt; 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 &amp;&amp; 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 != '.' &amp;&amp; $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&lt;div class=\"path\">\n&lt;div class=\"float-right\">\n&lt;?php if (FM_USE_AUTH): ?>&lt;a title=\"Logout\" href=\"?logout=1\">&lt;i class=\"icon-logout\">&lt;\/i>&lt;\/a>&lt;?php endif; ?>\n&lt;\/div>\n        &lt;?php\n        $path = fm_clean_path($path);\n        $root_url = \"&lt;a href='?p='>&lt;i class='icon-home' title='\" . FM_ROOT_PATH . \"'>&lt;\/i>&lt;\/a>\";\n        $sep = '&lt;i class=\"icon-separator\">&lt;\/i>';\n        if ($path != '') {\n            $exploded = explode('\/', $path);\n            $count = count($exploded);\n            $array = array();\n            $parent = '';\n            for ($i = 0; $i &lt; $count; $i++) {\n                $parent = trim($parent . '\/' . $exploded[$i], '\/');\n                $parent_enc = urlencode($parent);\n                $array[] = \"&lt;a href='?p={$parent_enc}'>\" . fm_convert_win($exploded[$i]) . \"&lt;\/a>\";\n            }\n            $root_url .= $sep . implode($sep, $array);\n        }\n        echo '&lt;div class=\"break-word\">' . $root_url . '&lt;\/div>';\n        ?>\n&lt;\/div>\n&lt;?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 '&lt;p class=\"message ' . $class . '\">' . $_SESSION['message'] . '&lt;\/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&lt;!DOCTYPE html>\n&lt;html>\n&lt;head>\n&lt;meta charset=\"utf-8\">\n&lt;title>PHP File Manager&lt;\/title>\n&lt;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(\"&lt;?php echo FM_SELF_URL ?>?img=sprites&amp;amp;t=&lt;?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&lt;\/style>\n&lt;link rel=\"icon\" href=\"&lt;?php echo FM_SELF_URL ?>?img=favicon\" type=\"image\/png\">\n&lt;link rel=\"shortcut icon\" href=\"&lt;?php echo FM_SELF_URL ?>?img=favicon\" type=\"image\/png\">\n&lt;?php if (isset($_GET['view']) &amp;&amp; FM_USE_HIGHLIGHTJS): ?>\n&lt;link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.2.0\/styles\/&lt;?php echo FM_HIGHLIGHTJS_STYLE ?>.min.css\">\n&lt;?php endif; ?>\n&lt;\/head>\n&lt;body>\n&lt;div id=\"wrapper\">\n&lt;?php\n}\n\n\/**\n * Show page footer\n *\/\nfunction fm_show_footer()\n{\n    ?>\n&lt;p class=\"center\">&lt;small>&lt;a href=\"https:\/\/github.com\/alexantr\/filemanager\" target=\"_blank\">PHP File Manager&lt;\/a>&lt;\/small>&lt;\/p>\n&lt;\/div>\n&lt;script>\nfunction newfolder(p){var n=prompt('New folder name','folder');if(n!==null&amp;&amp;n!==''){window.location.search='p='+encodeURIComponent(p)+'&amp;new='+encodeURIComponent(n);}}\nfunction rename(p,f){var n=prompt('New name',f);if(n!==null&amp;&amp;n!==''&amp;&amp;n!=f){window.location.search='p='+encodeURIComponent(p)+'&amp;ren='+encodeURIComponent(f)+'&amp;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&lt;\/script>\n&lt;?php if (isset($_GET['view']) &amp;&amp; FM_USE_HIGHLIGHTJS): ?>\n&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.2.0\/highlight.min.js\">&lt;\/script>\n&lt;script>hljs.initHighlightingOnLoad();&lt;\/script>\n&lt;?php endif; ?>\n&lt;\/body>\n&lt;\/html>\n&lt;?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' => 'iVBORw0KGgoAAAANSUhEUgAAABAAA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1HXz2DFGfOHp+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}<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[23],"tags":[],"class_list":["post-816","post","type-post","status-publish","format-standard","hentry","category-development_web"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=816"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/816\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}