Skip to content

Commit

Permalink
fix access array offset which doesn't exist and check if returned val…
Browse files Browse the repository at this point in the history
…ue is null

This check is used since default array is empty if user folder was not found

Signed-off-by: Jan Messer <[email protected]>
  • Loading branch information
Messj1 committed Jul 17, 2024
1 parent 22bf3f2 commit e22ba18
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/FilesHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ protected function fileMoving($oldPath, $newPath) {
}
$accessList = $this->getUserPathsFromPath($parentPath, $parentOwner);
$affectedUsers = $accessList['users'];
$oldUsers = $this->oldAccessList['users'];
$oldUsers = [];
if (isset($this->oldAccessList['users'])) {
$oldUsers = $this->oldAccessList['users'];
}

// file can be shared using GroupFolders, including ACL check
if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) {
Expand All @@ -416,7 +419,10 @@ protected function fileMoving($oldPath, $newPath) {
$moveUsers = array_intersect($beforeUsers, $afterUsers);
$this->generateMoveActivities($moveUsers, $oldUsers, $affectedUsers, $fileId, $oldFileName, $parentId, $fileName);

$beforeRemotes = $this->oldAccessList['remotes'];
$beforeRemotes = [];
if (isset($this->oldAccessList['users'])) {
$beforeRemotes = $this->oldAccessList['remotes'];
}
$afterRemotes = $accessList['remotes'];

$addRemotes = $deleteRemotes = $moveRemotes = [];
Expand Down

0 comments on commit e22ba18

Please sign in to comment.