Fixes #6514 -- Hide all dot-prefixed files, not just our protected directories.
This commit is contained in:
parent
bbd92f60ac
commit
1dc0cc32fd
|
@ -205,7 +205,7 @@ final class ListAction implements SingleActionInterface
|
|||
$files = $fs->listContents($currentDir, false)->filter(
|
||||
fn(StorageAttributes $attributes) => !(
|
||||
$currentDir === ''
|
||||
&& StationFilesystems::isProtectedDir($attributes->path())
|
||||
&& StationFilesystems::isDotFile($attributes->path())
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ final class ListDirectoriesAction implements SingleActionInterface
|
|||
|
||||
$directoriesRaw = $fsMedia->listContents($currentDir, false)->filter(
|
||||
fn(StorageAttributes $attrs) => $attrs->isDir()
|
||||
&& !StationFilesystems::isProtectedDir($attrs->path())
|
||||
&& !StationFilesystems::isDotFile($attrs->path())
|
||||
)->sortByPath();
|
||||
|
||||
$directories = [];
|
||||
|
|
|
@ -35,7 +35,7 @@ final class GetApplyToAction implements SingleActionInterface
|
|||
|
||||
// Iterate all directories to show them as selectable.
|
||||
$fsIterator = $fsMedia->listContents('/', true)->filter(
|
||||
fn(StorageAttributes $attrs) => $attrs->isDir() && !StationFilesystems::isProtectedDir($attrs->path())
|
||||
fn(StorageAttributes $attrs) => $attrs->isDir() && !StationFilesystems::isDotFile($attrs->path())
|
||||
)->sortByPath();
|
||||
|
||||
$directories = [
|
||||
|
|
|
@ -98,10 +98,11 @@ final class StationFilesystems
|
|||
return new LocalFilesystem(new LocalFilesystemAdapter($path));
|
||||
}
|
||||
|
||||
public static function isProtectedDir(string $path): bool
|
||||
public static function isDotFile(string $path): bool
|
||||
{
|
||||
foreach (self::PROTECTED_DIRS as $protectedDir) {
|
||||
if (str_starts_with($path, $protectedDir)) {
|
||||
$pathParts = explode('/', $path);
|
||||
foreach ($pathParts as $part) {
|
||||
if (str_starts_with($part, '.')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ final class CheckMediaTask extends AbstractTask
|
|||
|
||||
try {
|
||||
$fsIterator = $fs->listContents('/', true)->filter(
|
||||
fn(StorageAttributes $attrs) => $attrs->isFile() && !StationFilesystems::isProtectedDir($attrs->path())
|
||||
fn(StorageAttributes $attrs) => $attrs->isFile() && !StationFilesystems::isDotFile($attrs->path())
|
||||
);
|
||||
} catch (FilesystemException $e) {
|
||||
$this->logger->error(
|
||||
|
|
Loading…
Reference in New Issue