Add files as string to tar archives

remotes/origin/fix-10825
Robin Appelman 2014-08-16 22:19:01 +07:00 committed by Morris Jobke
parent 88c32861bc
commit 63570df75f
1 changed files with 2 additions and 6 deletions

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