diff --git a/tinyfilemanager.php b/tinyfilemanager.php index c5a3e95e..400f3833 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -97,7 +97,7 @@ $favicon_path = ''; // Files and folders to excluded from listing -// e.g. array('myfile.html', 'personal-folder', '*.php', ...) +// e.g. array('myfile.html', 'personal-folder', '*.php', '/path/to/folder', ...) $exclude_items = array(); // Online office Docs Viewer @@ -1334,7 +1334,7 @@ function get_file_path() $folders = array(); $files = array(); $current_path = array_slice(explode("/", $path), -1)[0]; -if (is_array($objects) && fm_is_exclude_items($current_path)) { +if (is_array($objects) && fm_is_exclude_items($current_path, $path)) { foreach ($objects as $file) { if ($file == '.' || $file == '..') { continue; @@ -1343,9 +1343,9 @@ function get_file_path() continue; } $new_path = $path . '/' . $file; - if (@is_file($new_path) && fm_is_exclude_items($file)) { + if (@is_file($new_path) && fm_is_exclude_items($file, $new_path)) { $files[] = $file; - } elseif (@is_dir($new_path) && $file != '.' && $file != '..' && fm_is_exclude_items($file)) { + } elseif (@is_dir($new_path) && $file != '.' && $file != '..' && fm_is_exclude_items($file, $new_path)) { $folders[] = $file; } } @@ -1712,7 +1712,7 @@ function getSelected($l) $file = $_GET['view']; $file = fm_clean_path($file, false); $file = str_replace('/', '', $file); - if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file)) { + if ($file == '' || !is_file($path . '/' . $file) || !fm_is_exclude_items($file, $path . '/' . $file)) { fm_set_msg(lng('File not found'), 'error'); $FM_PATH = FM_PATH; fm_redirect(FM_SELF_URL . '?p=' . urlencode($FM_PATH)); @@ -1917,7 +1917,7 @@ class="edit-file">