summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2014-12-18 16:38:13 +0100
committerRobin Appelman <robin@icewind.nl>2014-12-18 16:38:13 +0100
commit1ef01de40288518ada48ba29374f29e5d1a97f8e (patch)
tree19df891fa8770698311d75b25e11af080a1b8ec2
parent10a0fc2856bfa68ff04a42f141829a6e66a9b2da (diff)
parente656af4c83481b62648335c5eccdf30f8fe56f88 (diff)
downloadnextcloud-server-1ef01de40288518ada48ba29374f29e5d1a97f8e.tar.gz
nextcloud-server-1ef01de40288518ada48ba29374f29e5d1a97f8e.zip
Merge pull request #12907 from owncloud/delete-invalid-external-share
Fix deleting invalid s2s shares
-rw-r--r--apps/files_sharing/lib/external/storage.php8
-rw-r--r--lib/private/files/view.php5
2 files changed, 13 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 3f1d631a35f..306a7b8db8a 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -167,6 +167,14 @@ class Storage extends DAV implements ISharedStorage {
}
}
+ public function file_exists($path) {
+ if ($path === '') {
+ return true;
+ } else {
+ return parent::file_exists($path);
+ }
+ }
+
/**
* check if the configured remote is a valid ownCloud instance
*
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index c01763cdad3..c21ec88ae0c 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -280,6 +280,11 @@ class View {
}
public function isDeletable($path) {
+ $absolutePath = $this->getAbsolutePath($path);
+ $mount = Filesystem::getMountManager()->find($absolutePath);
+ if ($mount->getInternalPath($absolutePath) === '') {
+ return $mount instanceof MoveableMount;
+ }
return $this->basicOperation('isDeletable', $path);
}