Skip to content
Snippets Groups Projects
Commit d8be9d96 authored by Sjors van der Pluijm's avatar Sjors van der Pluijm
Browse files

fixes #8376

parent 727e3e23
Branches
No related tags found
No related merge requests found
...@@ -44,17 +44,20 @@ if (\OC_Util::runningOnWindows()) { ...@@ -44,17 +44,20 @@ if (\OC_Util::runningOnWindows()) {
new \RecursiveDirectoryIterator($this->datadir . $path), new \RecursiveDirectoryIterator($this->datadir . $path),
\RecursiveIteratorIterator::CHILD_FIRST \RecursiveIteratorIterator::CHILD_FIRST
); );
foreach ($it as $file) { while ($it->valid()) {
/** /**
* @var \SplFileInfo $file * @var \SplFileInfo $file
*/ */
$file = $it->current();
if (in_array($file->getBasename(), array('.', '..'))) { if (in_array($file->getBasename(), array('.', '..'))) {
$it->next();
continue; continue;
} elseif ($file->isDir()) { } elseif ($file->isDir()) {
rmdir($file->getPathname()); rmdir($file->getPathname());
} elseif ($file->isFile() || $file->isLink()) { } elseif ($file->isFile() || $file->isLink()) {
unlink($file->getPathname()); unlink($file->getPathname());
} }
$it->next();
} }
return rmdir($this->datadir . $path); return rmdir($this->datadir . $path);
} catch (\UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment