diff options
author | Remco Brenninkmeijer <requist1@starmail.nl> | 2014-08-04 14:10:09 +0200 |
---|---|---|
committer | Remco Brenninkmeijer <requist1@starmail.nl> | 2014-08-04 14:10:09 +0200 |
commit | cb842ba793a09b23dcd0415d0322e99bb9650dd3 (patch) | |
tree | aceef634b7aa9dbf869da11aa952bed2daed1803 | |
parent | d1aaa7a12e6073b41f4702b2cc50921708e8ab6c (diff) | |
download | nextcloud-server-cb842ba793a09b23dcd0415d0322e99bb9650dd3.tar.gz nextcloud-server-cb842ba793a09b23dcd0415d0322e99bb9650dd3.zip |
Previous commit was not based on master, retry. Removed broken tar cutter, double extensions are not possible in temp files. Added tar support. Fixed extension switch.
-rw-r--r-- | lib/private/archive.php | 5 | ||||
-rw-r--r-- | lib/private/archive/tar.php | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/private/archive.php b/lib/private/archive.php index a62f22cf6d7..562172ddefa 100644 --- a/lib/private/archive.php +++ b/lib/private/archive.php @@ -20,11 +20,8 @@ abstract class OC_Archive{ case '.gz': case '.bz': case '.bz2': - if(strpos($path, '.tar.')) { - return new OC_Archive_TAR($path); - } - break; case '.tgz': + case '.tar': return new OC_Archive_TAR($path); } } diff --git a/lib/private/archive/tar.php b/lib/private/archive/tar.php index 21a995d9e50..3f64b4c5064 100644 --- a/lib/private/archive/tar.php +++ b/lib/private/archive/tar.php @@ -40,12 +40,14 @@ class OC_Archive_TAR extends OC_Archive{ if(strpos($file, '.')) { $extension=substr($file, strrpos($file, '.')); switch($extension) { - case 'gz': - case 'tgz': + case '.gz': + case '.tgz': return self::GZIP; - case 'bz': - case 'bz2': + case '.bz': + case '.bz2': return self::BZIP; + case '.tar': + return self::PLAIN; default: return self::PLAIN; } |