diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-14 10:06:13 +0200 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-06-14 10:06:13 +0200 |
commit | c8564c07955ead3e85daa67e1871a2c41df3a6d5 (patch) | |
tree | 134c228f43e641d34fbf342df2745ece43580fee /lib/files/storage/common.php | |
parent | 0a29d2029a719d42f347edb95bd6486c2ab842a8 (diff) | |
parent | 6c534c8165d3c3fba64e3cf5c05993a84733eef7 (diff) | |
download | nextcloud-server-c8564c07955ead3e85daa67e1871a2c41df3a6d5.tar.gz nextcloud-server-c8564c07955ead3e85daa67e1871a2c41df3a6d5.zip |
Merge branch 'master' into move-maint-start
Conflicts:
lib/util.php
Diffstat (limited to 'lib/files/storage/common.php')
-rw-r--r-- | lib/files/storage/common.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index e87fe3b5239..3da13ac4df0 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -138,27 +138,21 @@ abstract class Common implements \OC\Files\Storage\Storage { */ public function deleteAll($directory, $empty = false) { $directory = trim($directory, '/'); - - if (!$this->file_exists(\OCP\USER::getUser() . '/' . $directory) - || !$this->is_dir(\OCP\USER::getUser() . '/' . $directory) - ) { - return false; - } elseif (!$this->isReadable(\OCP\USER::getUser() . '/' . $directory)) { + if (!$this->is_dir($directory) || !$this->isReadable($directory)) { return false; } else { - $directoryHandle = $this->opendir(\OCP\USER::getUser() . '/' . $directory); + $directoryHandle = $this->opendir($directory); while ($contents = readdir($directoryHandle)) { - if ($contents != '.' && $contents != '..') { - $path = $directory . "/" . $contents; + if (!\OC\Files\Filesystem::isIgnoredDir($contents)) { + $path = $directory . '/' . $contents; if ($this->is_dir($path)) { $this->deleteAll($path); } else { - $this->unlink(\OCP\USER::getUser() . '/' . $path); // TODO: make unlink use same system path as is_dir + $this->unlink($path); } } } - //$this->closedir( $directoryHandle ); // TODO: implement closedir in OC_FSV - if ($empty == false) { + if ($empty === false) { if (!$this->rmdir($directory)) { return false; } |