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
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment