Add files as string to tar archives

This commit is contained in:
Robin Appelman 2014-08-16 22:19:01 +02:00 committed by Morris Jobke
parent 88c32861bc
commit 63570df75f

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