mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix error when adding string data to an archive
This commit is contained in:
parent
154ce0f68d
commit
3da1339cd8
2 changed files with 2 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ class OC_Archive_TAR extends OC_Archive{
|
|||
if($this->fileExists($path)){
|
||||
$this->remove($path);
|
||||
}
|
||||
if(file_exists($source)){
|
||||
if($source and $source[0]=='/' and file_exists($source)){
|
||||
$header=array();
|
||||
$dummy='';
|
||||
$this->tar->_openAppend();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class OC_Archive_ZIP extends OC_Archive{
|
|||
* @return bool
|
||||
*/
|
||||
function addFile($path,$source=''){
|
||||
if(file_exists($source)){
|
||||
if($source and $source[0]=='/' and file_exists($source)){
|
||||
$result=$this->zip->addFile($source,$path);
|
||||
}else{
|
||||
$result=$this->zip->addFromString($path,$source);
|
||||
|
|
|
|||
Loading…
Reference in a new issue