aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorSjors van der Pluijm <sjors@desjors.nl>2014-04-28 19:32:25 +0200
committerSjors van der Pluijm <sjors@desjors.nl>2014-04-28 19:32:25 +0200
commit54f482ff9cf4e0bae89a85c3c291204da5910d96 (patch)
tree72b6a1cf346d5c3e8c5a54bd8696e3002da6b881 /apps/files_trashbin
parentd7ec1fe44721d28cfc93191dc604132df41dd5db (diff)
downloadnextcloud-server-54f482ff9cf4e0bae89a85c3c291204da5910d96.tar.gz
nextcloud-server-54f482ff9cf4e0bae89a85c3c291204da5910d96.zip
refs #8376; added comment and applied patch on other files
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/lib/trashbin.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 9b931333b7f..495532561ea 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -883,11 +883,19 @@ class Trashbin {
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST);
$size = 0;
- foreach ($iterator as $path) {
+ /**
+ * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach
+ * This bug is fixed in PHP 5.5.9 or before
+ * See #8376
+ */
+ $iterator->rewind();
+ while ($iterator->valid()) {
+ $path = $iterator->current();
$relpath = substr($path, strlen($root) - 1);
if (!$view->is_dir($relpath)) {
$size += $view->filesize($relpath);
}
+ $iterator->next();
}
return $size;
}