summaryrefslogtreecommitdiffstats
path: root/lib/archive
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-08-19 05:54:16 +0200
committerRobin Appelman <icewind@owncloud.com>2012-08-19 05:54:16 +0200
commit50cc5d5921f254086cf0e6a62d881419754bcf57 (patch)
tree29f7d35804793edeb19609c54995c5ee78e35396 /lib/archive
parent808d6c58fe3e7ff1d33af3cc84fc67834b4916e0 (diff)
downloadnextcloud-server-50cc5d5921f254086cf0e6a62d881419754bcf57.tar.gz
nextcloud-server-50cc5d5921f254086cf0e6a62d881419754bcf57.zip
fix creating nested folders inside tar files
Diffstat (limited to 'lib/archive')
-rw-r--r--lib/archive/tar.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/archive/tar.php b/lib/archive/tar.php
index c8b3d5e6266..f6efd6d0ecc 100644
--- a/lib/archive/tar.php
+++ b/lib/archive/tar.php
@@ -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;