diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-27 11:35:57 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-05-27 11:35:57 -0400 |
commit | 16925672e885071afab1fe158dc206ab8ed93baf (patch) | |
tree | 143f64c88d7d47cb0f5a3a7641228a7cae24821b /lib/files/storage/common.php | |
parent | 0953b68556152187ed305323b64b186cc21c2ade (diff) | |
parent | 0c621ff6a93fe1b34c77257d83fd344489f59bab (diff) | |
download | nextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.tar.gz nextcloud-server-16925672e885071afab1fe158dc206ab8ed93baf.zip |
Merge branch 'master' into googledrive
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; } |