1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-10 18:14:00 +02:00

Fix if statements

Signed-off-by: Marco Dickert <marco@misterunknown.de>
This commit is contained in:
Marco Dickert
2020-07-18 15:33:46 +02:00
parent 526f3c50e3
commit 98a6089389

View File

@@ -31,15 +31,17 @@ class IFMArchive {
while (false !== $f = readdir($handle)) { while (false !== $f = readdir($handle)) {
if ($f != '.' && $f != '..') { if ($f != '.' && $f != '..') {
$filePath = $folder . '/' . $f; $filePath = $folder . '/' . $f;
if (file_exists($filePath) && is_readable($filePath)) if (file_exists($filePath) && is_readable($filePath)) {
if (is_file($filePath)) if (is_file($filePath)) {
if (!is_callable($exclude_callback) || $exclude_callback($f)) if (!is_callable($exclude_callback) || $exclude_callback($f))
$archive->addFile( $filePath, substr( $filePath, $offset ) ); $archive->addFile( $filePath, substr( $filePath, $offset ) );
elseif (is_dir($filePath)) } elseif (is_dir($filePath)) {
if (is_callable($exclude_callback)) if (is_callable($exclude_callback))
self::addFolder($archive, $filePath, $offset, $exclude_callback); self::addFolder($archive, $filePath, $offset, $exclude_callback);
else else
self::addFolder($archive, $filePath, $offset); self::addFolder($archive, $filePath, $offset);
}
}
} }
} }
closedir($handle); closedir($handle);