fix "Archive not created" error (#317)

fix "Archive not created" error while trying to create Tar archive
This commit is contained in:
Maxim Khokhryakov 2020-03-12 12:18:19 +05:00 committed by GitHub
parent 1501835f61
commit e8fc6d546a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2977,7 +2977,12 @@ class FM_Zipper_Tar
private function addFileOrDir($filename) private function addFileOrDir($filename)
{ {
if (is_file($filename)) { if (is_file($filename)) {
return $this->tar->addFile($filename); try {
$this->tar->addFile($filename);
return true;
} catch (Exception $e) {
return false;
}
} elseif (is_dir($filename)) { } elseif (is_dir($filename)) {
return $this->addDir($filename); return $this->addDir($filename);
} }