Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/apps.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-08-19 07:45:55 +0400
committerRobin Appelman <icewind@owncloud.com>2012-08-19 07:45:55 +0400
commit9f27c6fa0b5c9c5eb3ab35799386dae03af9e45c (patch)
tree54e599615c3df1e05bc7b764c0e8162013ef9779 /files_archive
parent1812aac5ec3d790af43454e6abe701f79ae9bde4 (diff)
ensure proper result format when using opendir on the archive storage backend
Diffstat (limited to 'files_archive')
-rw-r--r--files_archive/lib/storage.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/files_archive/lib/storage.php b/files_archive/lib/storage.php
index add00ed8d..a3271dc39 100644
--- a/files_archive/lib/storage.php
+++ b/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;