fix creating nested folders inside tar files

This commit is contained in:
Robin Appelman 2012-08-19 05:54:16 +02:00
parent 808d6c58fe
commit 50cc5d5921
1 changed files with 9 additions and 2 deletions

View File

@ -56,14 +56,21 @@ class OC_Archive_TAR extends OC_Archive{
* @return bool
*/
function addFolder($path){
$tmpBase=get_temp_dir().'/';
$tmpBase=OC_Helper::tmpFolder();
if(substr($path,-1,1)!='/'){
$path.='/';
}
if($this->fileExists($path)){
return false;
}
mkdir($tmpBase.$path);
$parts=explode('/',$path);
$folder=$tmpBase;
foreach($parts as $part){
$folder.='/'.$part;
if(!is_dir($folder)){
mkdir($folder);
}
}
$result=$this->tar->addModify(array($tmpBase.$path),'',$tmpBase);
rmdir($tmpBase.$path);
$this->fileList=false;