]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix return for empty Shared folder in opendir()
authorMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 1 Jan 2012 19:04:16 +0000 (14:04 -0500)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 1 Jan 2012 19:04:16 +0000 (14:04 -0500)
apps/files_sharing/sharedstorage.php

index d78e273bf3804252717824f2362383808ad9bb30..b0eaeecf7235f33ae0b7704f66218a38e7e51244 100644 (file)
@@ -79,20 +79,16 @@ class OC_Filestorage_Shared extends OC_Filestorage {
                if ($path == "" || $path == "/") {
                        $path = $this->datadir.$path;
                        $sharedItems = OC_Share::getItemsInFolder($path);
-                       if (empty($sharedItems)) {
-                               return false;
-                       } else {
-                               global $FAKEDIRS;
-                               $files = array();
-                               foreach ($sharedItems as $item) {
-                                       // If item is in the root of the shared storage provider and the item exists add it to the fakedirs
-                                       if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) {
-                                               $files[] = basename($item['target']);
-                                       }
+                       global $FAKEDIRS;
+                       $files = array();
+                       foreach ($sharedItems as $item) {
+                               // If item is in the root of the shared storage provider and the item exists add it to the fakedirs
+                               if (dirname($item['target'])."/" == $path && $this->file_exists(basename($item['target']))) {
+                                       $files[] = basename($item['target']);
                                }
-                               $FAKEDIRS['shared'] = $files;
-                               return opendir('fakedir://shared');
                        }
+                       $FAKEDIRS['shared'] = $files;
+                       return opendir('fakedir://shared');
                } else {
                        $source = $this->getSource($path);
                        if ($source) {