Skip to content

Commit e22ba18

Browse files
committed
fix access array offset which doesn't exist and check if returned value is null
This check is used since default array is empty if user folder was not found Signed-off-by: Jan Messer <jan@mtec-studios.ch>
1 parent 22bf3f2 commit e22ba18

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/FilesHooks.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ protected function fileMoving($oldPath, $newPath) {
396396
}
397397
$accessList = $this->getUserPathsFromPath($parentPath, $parentOwner);
398398
$affectedUsers = $accessList['users'];
399-
$oldUsers = $this->oldAccessList['users'];
399+
$oldUsers = [];
400+
if (isset($this->oldAccessList['users'])) {
401+
$oldUsers = $this->oldAccessList['users'];
402+
}
400403

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

419-
$beforeRemotes = $this->oldAccessList['remotes'];
422+
$beforeRemotes = [];
423+
if (isset($this->oldAccessList['users'])) {
424+
$beforeRemotes = $this->oldAccessList['remotes'];
425+
}
420426
$afterRemotes = $accessList['remotes'];
421427

422428
$addRemotes = $deleteRemotes = $moveRemotes = [];

0 commit comments

Comments
 (0)