ensure proper result format when using opendir on the archive storage backend

remotes/origin/stable45
Robin Appelman 14 years ago
parent 2ea46ee1ca
commit 808d6c58fe
  1. 11
      apps/files_archive/lib/storage.php

@ -39,11 +39,18 @@ class OC_Filestorage_Archive extends OC_Filestorage_Common{
}
public function opendir($path){
$path=$this->stripPath($path);
$content=$this->archive->getFolder($path);
foreach($content as &$file){
if(substr($path,-1)!=='/'){
$path.='/';
}
$files=$this->archive->getFolder($path);
$content=array();
foreach($files as $file){
if(substr($file,-1)=='/'){
$file=substr($file,0,-1);
}
if($file and strpos($file,'/')===false){
$content[]=$file;
}
}
$id=md5($this->path.$path);
OC_FakeDirStream::$dirs[$id]=$content;

Loading…
Cancel
Save