summaryrefslogtreecommitdiffstats
path: root/lib/private/archive
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-08-16 22:19:01 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-21 08:49:57 +0200
commit63570df75f82a309300182b5aca6491cfdca1bf8 (patch)
tree82c9f792edbeed06a3b14040fc18767dc222a016 /lib/private/archive
parent88c32861bccbc42d577f019daeeb6b7364406499 (diff)
downloadnextcloud-server-63570df75f82a309300182b5aca6491cfdca1bf8.tar.gz
nextcloud-server-63570df75f82a309300182b5aca6491cfdca1bf8.zip
Add files as string to tar archives
Diffstat (limited to 'lib/private/archive')
-rw-r--r--lib/private/archive/tar.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/private/archive/tar.php b/lib/private/archive/tar.php
index ad9630db1f3..31715c4778b 100644
--- a/lib/private/archive/tar.php
+++ b/lib/private/archive/tar.php
@@ -98,13 +98,9 @@ class OC_Archive_TAR extends OC_Archive {
$this->remove($path);
}
if ($source and $source[0] == '/' and file_exists($source)) {
- $header = array();
- $dummy = '';
- $this->tar->_openAppend();
- $result = $this->tar->_addfile($source, $header, $dummy, $dummy, $path);
- } else {
- $result = $this->tar->addString($path, $source);
+ $source = file_get_contents($source);
}
+ $result = $this->tar->addString($path, $source);
$this->fileList = false;
$this->cachedHeaders = false;
return $result;