Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isDeletable() check to OC\Files\Node::move() #27734

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/private/Files/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Daniel Rudolf <github.com@daniel-rudolf.de>
* @author Joas Schilling <coding@schilljs.com>
* @author Julius Härtl <jus@bitgrid.net>
* @author Morris Jobke <hey@morrisjobke.de>
Expand Down Expand Up @@ -435,6 +436,7 @@ public function move($targetPath) {
$targetPath = $this->normalizePath($targetPath);
$parent = $this->root->get(dirname($targetPath));
if (
$this->isDeletable() and
$parent instanceof Folder and
$this->isValidPath($targetPath) and
(
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Files/Node/NodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public function testMoveNoParent() {


public function testMoveParentIsFile() {
$this->expectException(\OCP\Files\NotPermittedException::class);
$this->expectException(\OCP\Files\NotFoundException::class);

$this->view->expects($this->never())
->method('rename');
Expand Down