From: Tim Düsterhus Date: Wed, 10 Aug 2022 09:02:15 +0000 (+0200) Subject: Remove PackageArchive::unzipPackageArchive() X-Git-Tag: 6.0.0_Alpha_1~1045^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d59b9b0e08f5fc772d4944ee7d78bd45e78c912;p=GitHub%2FWoltLab%2FWCF.git Remove PackageArchive::unzipPackageArchive() The `Tar` class is perfectly able to handle compressed tar archives, no need to explicitly extract. --- diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 5ccbaf6c46..8120a1441f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -503,10 +503,7 @@ class PackageArchive } $file->close(); - // unzip tar - $this->archive = self::unzipPackageArchive($tmpFile); - - return $this->archive; + return $tmpFile; } /** @@ -904,28 +901,6 @@ class PackageArchive return $filename; } - /** - * Unzips compressed package archives and returns the temporary file name. - * - * @param string $archive filename - * @return string - */ - public static function unzipPackageArchive($archive) - { - if (!FileUtil::isURL($archive)) { - $tar = new Tar($archive); - $tar->close(); - if ($tar->isZipped()) { - $tmpName = FileUtil::getTemporaryFilename('package_'); - if (FileUtil::uncompressFile($archive, $tmpName)) { - return $tmpName; - } - } - } - - return $archive; - } - /** * Returns a list of packages which exclude this package. *