From 72882beb0d6ba7ebb70bdd6265c15656376e742c Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Wed, 28 Mar 2012 23:53:51 +0200
Subject: [PATCH] enble browsing tar files in the web interface

---
 apps/files_archive/js/archive.js   | 4 ++++
 apps/files_archive/lib/storage.php | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/files_archive/js/archive.js b/apps/files_archive/js/archive.js
index ec316c7bf2..531eb61c01 100644
--- a/apps/files_archive/js/archive.js
+++ b/apps/files_archive/js/archive.js
@@ -11,5 +11,9 @@ $(document).ready(function() {
 			window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
 		});
 		FileActions.setDefault('application/zip','Open');
+		FileActions.register('application/x-gzip','Open','',function(filename){
+			window.location='index.php?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
+		});
+		FileActions.setDefault('application/x-gzip','Open');
 	}
 });
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php
index 598b85f0db..700d963304 100644
--- a/apps/files_archive/lib/storage.php
+++ b/apps/files_archive/lib/storage.php
@@ -125,7 +125,7 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
 			self::$rootView=new OC_FilesystemView('');
 		}
 		self::$enableAutomount=false;//prevent recursion
-		$supported=array('zip');
+		$supported=array('zip','tar.gz','tar.bz2','tgz');
 		foreach($supported as $type){
 			$ext='.'.$type.'/';
 			if(($pos=strpos(strtolower($path),$ext))!==false){
-- 
GitLab