Fix bug with adding subdirectories to archive

This commit is contained in:
Dmitriy Novash 2020-07-03 11:20:51 +03:00
parent f5a1261ddc
commit 481cff0f60
No known key found for this signature in database
GPG Key ID: D350E5788583C8BA

View File

@ -32,14 +32,15 @@ class IFMArchive {
if ($f != '.' && $f != '..') {
$filePath = $folder . '/' . $f;
if (file_exists($filePath) && is_readable($filePath))
if (is_file($filePath))
if (is_file($filePath)) {
if (!is_callable($exclude_callback) || $exclude_callback($f))
$archive->addFile( $filePath, substr( $filePath, $offset ) );
elseif (is_dir($filePath))
} elseif (is_dir($filePath)) {
if (is_callable($exclude_callback))
self::addFolder($archive, $filePath, $offset, $exclude_callback);
else
self::addFolder($archive, $filePath, $offset);
}
}
}
closedir($handle);
@ -55,7 +56,7 @@ class IFMArchive {
if (!is_array($src))
$src = array($src);
file_put_contents("debug.ifm.log", var_export(is_callable($exclude_callback), true)."\n");
//file_put_contents("debug.ifm.log", var_export(is_callable($exclude_callback), true)."\n");
foreach ($src as $s)
if (is_dir($s))