aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files/storage
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-07 17:12:16 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-07 17:12:16 +0200
commitf35578ec54b5ce4133e668625d6a7a34bfc6b1e9 (patch)
tree6a603a3e0f2c5637529f64c90750d78e9e3e9c4f /lib/files/storage
parentbd675124096707a925faac2774516975ec7049c1 (diff)
parent81b6cab94fcaa5c3bc76a92d38997cd7928cb37d (diff)
downloadnextcloud-server-f35578ec54b5ce4133e668625d6a7a34bfc6b1e9.tar.gz
nextcloud-server-f35578ec54b5ce4133e668625d6a7a34bfc6b1e9.zip
merge master into storage-wrapper
Diffstat (limited to 'lib/files/storage')
-rw-r--r--lib/files/storage/common.php18
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;
}