fix error when adding string data to an archive

remotes/origin/stable45
Robin Appelman 2012-08-19 05:04:58 +07:00
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);