diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 8feaff4..2f11022 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -11,12 +11,8 @@ $CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false}'; //TFM version define('VERSION', '2.3.5'); -// Page Title. Leave blank for default. -$page_title = ''; - -// Favicon path. This can be either a full url to an image, or -// a path based on the document root. leave blank for default. -$favicon_path = ''; +//Application Title +define('APP_TITLE', 'Tiny File Manager'); // Auth with login/password (set true/false to enable/disable it) $use_auth = true; @@ -50,6 +46,7 @@ $edit_files = true; $default_timezone = 'Etc/UTC'; // UTC // Root path for file manager +// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder' $root_path = $_SERVER['DOCUMENT_ROOT']; // Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder' @@ -68,6 +65,9 @@ $datetime_format = 'd.m.y H:i'; // allowed file extensions for upload and rename $allowed_extensions = ''; // 'gif,png,jpg' +// Favicon path. This can be either a full url to an .PNG image, or a path based on the document root. +$favicon_path = '?img=favicon'; + // Array of files and folders excluded from listing $GLOBALS['exclude_items'] = array(); @@ -206,7 +206,7 @@ if ($use_auth) {
-

+

@@ -265,24 +265,6 @@ if (!@is_dir($root_path)) { exit; } -// clean and check faviocn path -if(!empty($favicon_path)) { - $favicon_path = trim($favicon_path); - if(strtolower(substr($favicon_path, 0, 4)) !== 'http') { - $favicon_path = trim($favicon_path, '\\/'); - $favicon_path = $root_url . '/' . $favicon_url; - } -} else { - $favicon_path = $root_url . '?img=favicon'; -} - -// Clean page title -if(!empty($page_title)) { - $page_title = trim($page_title); -} else { - $page_title = 'H3K | Tiny File Manager'; -} - defined('FM_SHOW_HIDDEN') || define('FM_SHOW_HIDDEN', $show_hidden_files); defined('FM_ROOT_PATH') || define('FM_ROOT_PATH', $root_path); defined('FM_LANG') || define('FM_LANG', $lang); @@ -645,6 +627,7 @@ if (isset($_GET['dl'])) { // Upload if (!empty($_FILES) && !FM_READONLY) { + $override_file_name = false; $f = $_FILES; $path = FM_ROOT_PATH; $ds = DIRECTORY_SEPARATOR; @@ -666,7 +649,7 @@ if (!empty($_FILES) && !FM_READONLY) { $fullPath = $path . '/' . $_REQUEST['fullpath']; $folder = substr($fullPath, 0, strrpos($fullPath, "/")); - if(file_exists ($fullPath)) { + if(file_exists ($fullPath) && !$override_file_name) { $ext_1 = $ext ? '.'.$ext : ''; $fullPath = str_replace($ext_1, '', $fullPath) .'_'. date('ymdHis'). $ext_1; } @@ -2843,7 +2826,7 @@ header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); header("Pragma: no-cache"); -global $lang, $root_url, $favicon_path, $page_title; +global $lang, $root_url, $favicon_path; ?> @@ -2854,8 +2837,8 @@ global $lang, $root_url, $favicon_path, $page_title; - - <?php echo $page_title ?> + + <?php echo fm_enc(APP_TITLE) ?>