]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add files as string to tar archives
authorRobin Appelman <icewind@owncloud.com>
Sat, 16 Aug 2014 20:19:01 +0000 (22:19 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 21 Aug 2014 06:49:57 +0000 (08:49 +0200)
lib/private/archive/tar.php

index ad9630db1f396a6c0e86893c0e794b490557ec95..31715c4778b53e7b2f1fb62b0cceef01c1432d48 100644 (file)
@@ -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;