Skip to content

Commit 1449250

Browse files
Merge pull request #226 from nextcloud/allow_root_file_rename
Properly construct path of root on file rename
2 parents 26c6ead + 50e2398 commit 1449250

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/FilesHooks.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,12 @@ protected function getUserPathsFromPath($path, $uidOwner) {
617617

618618
$path = $node->getPath();
619619
$sections = explode('/', $path, 4);
620-
$accessList['ownerPath'] = '/' . $sections[3];
620+
621+
$accessList['ownerPath'] = '/';
622+
if (isset($sections[3])) {
623+
// Not the case when a file in root is renamed
624+
$accessList['ownerPath'] .= $sections[3];
625+
}
621626

622627
return $accessList;
623628
}

0 commit comments

Comments
 (0)