summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
parentd7ec1fe44721d28cfc93191dc604132df41dd5db (diff)
downloadnextcloud-server-54f482ff9cf4e0bae89a85c3c291204da5910d96.tar.gz
nextcloud-server-54f482ff9cf4e0bae89a85c3c291204da5910d96.zip
refs #8376; added comment and applied patch on other files
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/local.php5
-rw-r--r--lib/private/files/storage/mappedlocal.php11
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index ed2ad870858..de940fc7cdb 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -44,6 +44,11 @@ if (\OC_Util::runningOnWindows()) {
new \RecursiveDirectoryIterator($this->datadir . $path),
\RecursiveIteratorIterator::CHILD_FIRST
);
+ /**
+ * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach
+ * This bug is fixed in PHP 5.5.9 or before
+ * See #8376
+ */
$it->rewind();
while ($it->valid()) {
/**
diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php
index 75582fd6c83..f995cb00c7a 100644
--- a/lib/private/files/storage/mappedlocal.php
+++ b/lib/private/files/storage/mappedlocal.php
@@ -39,17 +39,26 @@ class MappedLocal extends \OC\Files\Storage\Common{
new \RecursiveDirectoryIterator($this->buildPath($path)),
\RecursiveIteratorIterator::CHILD_FIRST
);
- foreach ($it as $file) {
+ /**
+ * RecursiveDirectoryIterator on an NFS path isn't iterable with foreach
+ * This bug is fixed in PHP 5.5.9 or before
+ * See #8376
+ */
+ $it->rewind();
+ while ($it->valid()) {
/**
* @var \SplFileInfo $file
*/
+ $file = $it->current();
if (in_array($file->getBasename(), array('.', '..'))) {
+ $it->next();
continue;
} elseif ($file->isDir()) {
rmdir($file->getPathname());
} elseif ($file->isFile() || $file->isLink()) {
unlink($file->getPathname());
}
+ $it->next();
}
if ($result = @rmdir($this->buildPath($path))) {
$this->cleanMapper($path);