From 54f482ff9cf4e0bae89a85c3c291204da5910d96 Mon Sep 17 00:00:00 2001 From: Sjors van der Pluijm Date: Mon, 28 Apr 2014 19:32:25 +0200 Subject: refs #8376; added comment and applied patch on other files --- apps/files_trashbin/lib/trashbin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'apps/files_trashbin') 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; } -- cgit v1.2.3 From 49822dfcdb752428b43040a26d97c5e52ecf3458 Mon Sep 17 00:00:00 2001 From: Sjors van der Pluijm Date: Tue, 29 Apr 2014 14:59:47 +0200 Subject: refs #8376; spaces=>tabs --- apps/files_trashbin/lib/trashbin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files_trashbin') diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 495532561ea..173eb2164cf 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -883,7 +883,7 @@ class Trashbin { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST); $size = 0; - /** + /** * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach * This bug is fixed in PHP 5.5.9 or before * See #8376 -- cgit v1.2.3