diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-08-19 05:45:55 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-08-19 05:45:55 +0200 |
commit | 808d6c58fe3e7ff1d33af3cc84fc67834b4916e0 (patch) | |
tree | c26ea55fd4ce5c5fa6f863b8a318f5cf884ea8ae | |
parent | 2ea46ee1ca6f95d05f8e05808729fe23d97d55ba (diff) | |
download | nextcloud-server-808d6c58fe3e7ff1d33af3cc84fc67834b4916e0.tar.gz nextcloud-server-808d6c58fe3e7ff1d33af3cc84fc67834b4916e0.zip |
ensure proper result format when using opendir on the archive storage backend
-rw-r--r-- | apps/files_archive/lib/storage.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_archive/lib/storage.php b/apps/files_archive/lib/storage.php index add00ed8d8e..a3271dc390f 100644 --- a/apps/files_archive/lib/storage.php +++ b/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; |