From 22156d230dd58f8b30b0189b5c307c0c27341edf Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 28 Mar 2024 21:42:37 +0200 Subject: [PATCH] fix snaps filename selection --- src/cli/document/clean.php | 2 +- src/cli/document/crawl.php | 2 +- src/webui/explore.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/document/clean.php b/src/cli/document/clean.php index 12eb3fd..481f939 100644 --- a/src/cli/document/clean.php +++ b/src/cli/document/clean.php @@ -125,7 +125,7 @@ foreach ($config->cli->document->crawl->skip->stripos->url as $condition) { foreach ((array) scandir($location) as $filename) { - if (is_dir($filename) || is_link($filename) || str_starts_with($filename, '.') || !str_ends_with($filename, '.tar.gz')) + if (!str_ends_with($filename, '.tar.gz')) { continue; } diff --git a/src/cli/document/crawl.php b/src/cli/document/crawl.php index 3b0ca92..6a7f6b3 100644 --- a/src/cli/document/crawl.php +++ b/src/cli/document/crawl.php @@ -13,7 +13,7 @@ function getLastSnapTime(array $files): int foreach ($files as $file) { - if (is_dir($file) || is_link($file) || str_starts_with($file, '.')) + if (!str_ends_with($filename, '.tar.gz')) { continue; } diff --git a/src/webui/explore.php b/src/webui/explore.php index 5c8d61c..6e77d4a 100644 --- a/src/webui/explore.php +++ b/src/webui/explore.php @@ -105,7 +105,7 @@ if ($config->snap->storage->local->enabled) { foreach ((array) scandir($directory) as $filename) { - if (is_dir($filename) || is_link($filename) || str_starts_with($filename, '.')) + if (!str_ends_with($filename, '.tar.gz')) { continue; } @@ -164,7 +164,7 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp) foreach ((array) $remote->nlist($filepath) as $filename) { - if (is_dir($filename) || is_link($filename) || str_starts_with($filename, '.')) + if (!str_ends_with($filename, '.tar.gz')) { continue; }