diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-10-07 11:07:52 (GMT) |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-10-07 11:09:33 (GMT) |
commit | 46a1580a7b7f71b65c008a428ae8d3d7ef9560ae (patch) | |
tree | 3cc62d77ac9bd33702ec22d45b45522f6971bb9a /lib/Kolab | |
parent | 476108442902a017be8727658eaecb5a69b1a31d (diff) | |
download | iRony-46a1580a7b7f71b65c008a428ae8d3d7ef9560ae.tar.gz |
Fix listing files on non-first level folders (#3739)
Diffstat (limited to 'lib/Kolab')
-rw-r--r-- | lib/Kolab/DAV/Collection.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Kolab/DAV/Collection.php b/lib/Kolab/DAV/Collection.php index c050458..d8d39b7 100644 --- a/lib/Kolab/DAV/Collection.php +++ b/lib/Kolab/DAV/Collection.php @@ -56,7 +56,7 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection // get subfolders foreach ($folders as $folder) { // need root-folders or subfolders of specified folder - if (!$path_len || ($pos = strpos($folder, $this->path . '/')) === 0) { + if (!$path_len || strpos($folder, $this->path . '/') === 0) { $virtual = false; // remove path suffix, the list might contain folders (roots) that @@ -71,12 +71,12 @@ class Collection extends \Kolab\DAV\Node implements \Sabre\DAV\ICollection $virtual = true; } - if (!array_key_exists($folder, $this->children)) { - $path = Collection::ROOT_DIRECTORY . '/' . $folder; - if ($path_len) { - $folder = substr($folder, $path_len + 1); - } + $path = Collection::ROOT_DIRECTORY . '/' . $folder; + if ($path_len) { + $folder = substr($folder, $path_len + 1); + } + if (!array_key_exists($folder, $this->children)) { $this->children[$folder] = new Collection($path, $this, array('virtual' => $virtual)); } } |