diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-12-02 15:14:41 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-12-02 15:14:41 -0800 |
commit | a999350f6936a15906ef5f4b9c3f74d0b1479a8f (patch) | |
tree | 738802cf435364c7c23228d826dd9ec830dd102e /lib/private | |
parent | 83ec234f530b152b7110b287c216bc0a2b6d1042 (diff) | |
parent | 64bfcbee0ac80b75b722117da85f6b70f60c4d83 (diff) | |
download | nextcloud-server-a999350f6936a15906ef5f4b9c3f74d0b1479a8f.tar.gz nextcloud-server-a999350f6936a15906ef5f4b9c3f74d0b1479a8f.zip |
Merge pull request #6158 from owncloud/rmdir-check
check if a directory exists before we try to remove it
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/view.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 8cb56ede91b..ac45a881331 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -159,7 +159,11 @@ class View { } public function rmdir($path) { - return $this->basicOperation('rmdir', $path, array('delete')); + if ($this->is_dir($path)) { + return $this->basicOperation('rmdir', $path, array('delete')); + } else { + return false; + } } public function opendir($path) { @@ -712,7 +716,7 @@ class View { return false; } $defaultRoot = Filesystem::getRoot(); - if($this->fakeRoot === $defaultRoot){ + if ($this->fakeRoot === $defaultRoot) { return true; } return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); |