From a543d20958592f0d354d1629c7408121eaabd8a7 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 18 Sep 2015 22:54:19 +0200 Subject: [PATCH] Fix #19181: Support .bz2 app archives At first a bz2 handling in needs to be fixed; PEAR's Archive_Tar otherwise gives the following error: > Unsupported compression type "bz" > Supported types are "gz", "bz2" and "lzma2" After that we can whitelist the application/bz2 MIME type in the installer. --- lib/private/archive/tar.php | 2 +- lib/private/installer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/archive/tar.php b/lib/private/archive/tar.php index 6dd6511598d..4448e56850d 100644 --- a/lib/private/archive/tar.php +++ b/lib/private/archive/tar.php @@ -48,7 +48,7 @@ class OC_Archive_TAR extends OC_Archive { * @param string $source */ function __construct($source) { - $types = array(null, 'gz', 'bz'); + $types = array(null, 'gz', 'bz2'); $this->path = $source; $this->tar = new Archive_Tar($source, $types[self::getTarType($source)]); } diff --git a/lib/private/installer.php b/lib/private/installer.php index b5ccc02abf3..86968a7c189 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -279,7 +279,7 @@ class OC_Installer{ //detect the archive type $mime=OC_Helper::getMimeType($path); - if ($mime !=='application/zip' && $mime !== 'application/x-gzip') { + if ($mime !=='application/zip' && $mime !== 'application/x-gzip' && $mime !== 'application/x-bzip2') { throw new \Exception($l->t("Archives of type %s are not supported", array($mime))); }