]> source.dussan.org Git - nextcloud-server.git/commitdiff
Also check if the file itself is updatable
authorRobin Appelman <icewind@owncloud.com>
Mon, 25 Aug 2014 12:28:35 +0000 (14:28 +0200)
committerLukas Reschke <lukas@owncloud.com>
Wed, 17 Sep 2014 09:35:16 +0000 (11:35 +0200)
apps/files_external/lib/streamwrapper.php
apps/files_external/lib/swift.php
lib/private/files/storage/common.php

index adccb2919e3c9fadc4d08204ca7e6c5a5989a1af..b55bcf94af8cffd844a6f245430b45f09301b2cb 100644 (file)
@@ -21,7 +21,7 @@ abstract class StreamWrapper extends Common {
        }
 
        public function rmdir($path) {
-               if ($this->file_exists($path) and $this->isDeletable($path)) {
+               if ($this->file_exists($path) && $this->isDeletable($path)) {
                        $dh = $this->opendir($path);
                        while (($file = readdir($dh)) !== false) {
                                if ($this->is_dir($path . '/' . $file)) {
index 11186a9f394785da4df1c69f337a96d6a498087a..6a1e12986fbb80c0d8cd4613d43092caa257225d 100644 (file)
@@ -187,7 +187,7 @@ class Swift extends \OC\Files\Storage\Common {
        public function rmdir($path) {
                $path = $this->normalizePath($path);
 
-               if (!$this->is_dir($path) or !$this->isDeletable($path)) {
+               if (!$this->is_dir($path) || !$this->isDeletable($path)) {
                        return false;
                }
 
index 4680971b278c42007cd0bb376cd5edcad95954fd..483a9ac6668354af982dde7441a581f51905e2ac 100644 (file)
@@ -95,11 +95,11 @@ abstract class Common implements \OC\Files\Storage\Storage {
        }
 
        public function isDeletable($path) {
-               if ($path === '' or $path === '/') {
+               if ($path === '' || $path === '/') {
                        return false;
                }
                $parent = dirname($path);
-               return $this->isUpdatable($parent);
+               return $this->isUpdatable($parent) and $this->isUpdatable($path);
        }
 
        public function isSharable($path) {