From 74ed9b9ef7cf0a226355d353042a22f1a5941712 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 8 Oct 2020 17:06:25 +0200 Subject: [PATCH] fix file checks --- Utils/IO/Zip/Tar.php | 2 +- Utils/IO/Zip/TarGz.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Utils/IO/Zip/Tar.php b/Utils/IO/Zip/Tar.php index a6819221f..bd4f0c339 100644 --- a/Utils/IO/Zip/Tar.php +++ b/Utils/IO/Zip/Tar.php @@ -90,7 +90,7 @@ class Tar implements ArchiveInterface */ public static function unpack(string $source, string $destination) : bool { - if (!\is_dir($source)) { + if (!\is_file($source)) { return false; } diff --git a/Utils/IO/Zip/TarGz.php b/Utils/IO/Zip/TarGz.php index c5ba4ffcf..9364afd58 100644 --- a/Utils/IO/Zip/TarGz.php +++ b/Utils/IO/Zip/TarGz.php @@ -57,7 +57,7 @@ class TarGz implements ArchiveInterface public static function unpack(string $source, string $destination) : bool { $destination = \str_replace('\\', '/', $destination); - if (!\is_dir($destination) || \is_file($source)) { + if (!\is_dir($destination) || !\is_file($source)) { return false; }