Also check if the file itself is updatable

remotes/origin/fix-10825
Robin Appelman 11 years ago committed by Lukas Reschke
parent d25a9a118f
commit 2f22e67570
  1. 2
      apps/files_external/lib/streamwrapper.php
  2. 2
      apps/files_external/lib/swift.php
  3. 4
      lib/private/files/storage/common.php

@ -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)) {

@ -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;
}

@ -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) {

Loading…
Cancel
Save