diff --git a/composer.json b/composer.json index fa0956a..900fa7c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "kiwilan/php-archive", - "version": "1.5.1", + "version": "1.5.11", "description": "PHP package to handle archives (.zip, .rar, .tar, .7z) or .pdf with hybrid solution (native/p7zip), designed to works with eBooks (.epub, .cbz, .cbr, .cb7, .cbt).", "keywords": [ "php", diff --git a/src/Readers/BaseArchive.php b/src/Readers/BaseArchive.php index 89bf284..1b36690 100755 --- a/src/Readers/BaseArchive.php +++ b/src/Readers/BaseArchive.php @@ -197,6 +197,9 @@ protected function findFiles(string $search, bool $skipHidden): array }); $filtered = array_values($filtered); + $property = 'rootPath'; + $sort = fn ($a, $b) => strnatcmp($a->{$property}(), $b->{$property}()); + usort($files, $sort); return $filtered; }