Fix LocalStorage->unlink to work on folder as expected
This commit is contained in:
parent
8187164fe1
commit
af35b6ad9d
|
@ -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) {
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue