Skip to content
Snippets Groups Projects
Commit 3da1339c authored by Robin Appelman's avatar Robin Appelman
Browse files

fix error when adding string data to an archive

parent 154ce0f6
Branches
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ class OC_Archive_TAR extends OC_Archive{ ...@@ -79,7 +79,7 @@ class OC_Archive_TAR extends OC_Archive{
if($this->fileExists($path)){ if($this->fileExists($path)){
$this->remove($path); $this->remove($path);
} }
if(file_exists($source)){ if($source and $source[0]=='/' and file_exists($source)){
$header=array(); $header=array();
$dummy=''; $dummy='';
$this->tar->_openAppend(); $this->tar->_openAppend();
......
...@@ -36,7 +36,7 @@ class OC_Archive_ZIP extends OC_Archive{ ...@@ -36,7 +36,7 @@ class OC_Archive_ZIP extends OC_Archive{
* @return bool * @return bool
*/ */
function addFile($path,$source=''){ function addFile($path,$source=''){
if(file_exists($source)){ if($source and $source[0]=='/' and file_exists($source)){
$result=$this->zip->addFile($source,$path); $result=$this->zip->addFile($source,$path);
}else{ }else{
$result=$this->zip->addFromString($path,$source); $result=$this->zip->addFromString($path,$source);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment