summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-05-06 15:54:48 +0200
committerRobin Appelman <icewind@owncloud.com>2014-05-28 18:16:24 +0200
commitaf35b6ad9db6490f5bfd25143d214f5b1d8dfd34 (patch)
tree81b0863fc8ae2c231602e450292462b5707d6ad5 /lib
parent8187164fe1c125c478f1c9f64700626d329aa0d1 (diff)
downloadnextcloud-server-af35b6ad9db6490f5bfd25143d214f5b1d8dfd34.tar.gz
nextcloud-server-af35b6ad9db6490f5bfd25143d214f5b1d8dfd34.zip
Fix LocalStorage->unlink to work on folder as expected
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/local.php9
-rw-r--r--lib/private/files/view.php2
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index 43ffeaf80c7..943c4163088 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -164,7 +164,14 @@ if (\OC_Util::runningOnWindows()) {
}
public function unlink($path) {
- return unlink($this->datadir . $path);
+ if ($this->is_dir($path)) {
+ return $this->rmdir($path);
+ } else if ($this->is_file($path)) {
+ return unlink($this->datadir . $path);
+ } else {
+ return false;
+ }
+
}
public function rename($path1, $path2) {
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 940f31fe420..0743d5c6d93 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -432,7 +432,7 @@ class View {
if ($this->is_dir($path1)) {
$result = $this->copy($path1, $path2);
if ($result === true) {
- $result = $storage1->unlink($internalPath1);
+ $result = $storage1->rmdir($internalPath1);
}
} else {
$source = $this->fopen($path1 . $postFix1, 'r');