mirror of
https://github.com/jcampbell1/simple-file-manager.git
synced 2025-02-20 22:00:04 +01:00
Use func params instead of global keyword
This commit is contained in:
@@ -64,7 +64,7 @@ if($_GET['do'] == 'list') {
|
|||||||
$directory = $file;
|
$directory = $file;
|
||||||
$result = [];
|
$result = [];
|
||||||
$files = array_diff(scandir($directory), ['.','..']);
|
$files = array_diff(scandir($directory), ['.','..']);
|
||||||
foreach ($files as $entry) if (!is_entry_ignored($entry)) {
|
foreach ($files as $entry) if (!is_entry_ignored($entry, $allow_show_folders, $hidden_extensions)) {
|
||||||
$i = $directory . '/' . $entry;
|
$i = $directory . '/' . $entry;
|
||||||
$stat = stat($i);
|
$stat = stat($i);
|
||||||
$result[] = [
|
$result[] = [
|
||||||
@@ -120,12 +120,11 @@ if($_GET['do'] == 'list') {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_entry_ignored($entry) {
|
function is_entry_ignored($entry, $allow_show_folders, $hidden_extensions) {
|
||||||
if ($entry === basename(__FILE__)) {
|
if ($entry === basename(__FILE__)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
global $allow_show_folders;
|
|
||||||
if (is_dir($entry) && !$allow_show_folders) {
|
if (is_dir($entry) && !$allow_show_folders) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user