diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-17 13:56:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-17 13:56:36 +0100 |
commit | 26eda9dd58788fa88cbbe3dccddd6ee263700c8a (patch) | |
tree | ef419375a5d2324b35c2ad779f4fd6532ffac58e /lib | |
parent | 0c0ce25b3cbc23b98e60d4a68e2242d91fab9eec (diff) | |
parent | 70bd819dd22e34cfc7882e4b5f3484bb421a0c8d (diff) | |
download | nextcloud-server-26eda9dd58788fa88cbbe3dccddd6ee263700c8a.tar.gz nextcloud-server-26eda9dd58788fa88cbbe3dccddd6ee263700c8a.zip |
Merge pull request #3892 from nextcloud/downstream-27101
Redirect unlink to rmdir
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/View.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index db21d400b39..6ffb5edff3e 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -692,7 +692,11 @@ class View { if ($mount and $mount->getInternalPath($absolutePath) === '') { return $this->removeMount($mount, $absolutePath); } - $result = $this->basicOperation('unlink', $path, array('delete')); + if ($this->is_dir($path)) { + $result = $this->basicOperation('rmdir', $path, ['delete']); + } else { + $result = $this->basicOperation('unlink', $path, ['delete']); + } if (!$result && !$this->file_exists($path)) { //clear ghost files from the cache on delete $storage = $mount->getStorage(); $internalPath = $mount->getInternalPath($absolutePath); |