diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 05bacbd..2cb8739 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -1348,7 +1348,7 @@ if (isset($_GET['help'])) { if (isset($_GET['view'])) { $file = $_GET['view']; $quickView = (isset($_GET['quickView']) && $_GET['quickView'] == 1) ? true : false; - $file = fm_clean_path($file); + $file = fm_clean_path($file, false); $file = str_replace('/', '', $file); if ($file == '' || !is_file($path . '/' . $file) || in_array($file, $GLOBALS['exclude_items'])) { fm_set_msg('File not found', 'error'); @@ -1543,7 +1543,7 @@ if (isset($_GET['view'])) { // file editor if (isset($_GET['edit'])) { $file = $_GET['edit']; - $file = fm_clean_path($file); + $file = fm_clean_path($file, false); $file = str_replace('/', '', $file); if ($file == '' || !is_file($path . '/' . $file)) { fm_set_msg('File not found', 'error'); @@ -2132,9 +2132,9 @@ function get_absolute_path($path) { * @param string $path * @return string */ -function fm_clean_path($path) +function fm_clean_path($path, $trim = true) { - $path = trim($path); + $path = $trim ? trim($path) : $path; $path = trim($path, '\\/'); $path = str_replace(array('../', '..\\'), '', $path); $path = get_absolute_path($path); @@ -3007,7 +3007,7 @@ global $lang, $root_url, $favicon_path; <?php echo fm_enc(APP_TITLE) ?> - +