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.
This commit is contained in:
Christian Weiske 2015-09-18 22:54:19 +02:00
parent a0e479342c
commit a543d20958
2 changed files with 2 additions and 2 deletions

View File

@ -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)]);
}

View File

@ -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)));
}