Skip to content

Commit f371e65

Browse files
committed
fix access array offset which doesn't exist
Successor hook fileMovePost is only processed if no error occured in fileMove hook Signed-off-by: Jan Messer <[email protected]>
1 parent 327dcd0 commit f371e65

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/FilesHooks.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ public function fileMove($oldPath, $newPath) {
234234
return;
235235
}
236236

237+
$moveCase = $this->moveCase;
237238
if (strpos($oldDir, $newDir) === 0) {
238239
/**
239240
* a/b/c moved to a/c
@@ -243,7 +244,7 @@ public function fileMove($oldPath, $newPath) {
243244
* - a/b/ shared: delete
244245
* - a/ shared: move/rename
245246
*/
246-
$this->moveCase = 'moveUp';
247+
$moveCase = 'moveUp';
247248
} elseif (strpos($newDir, $oldDir) === 0) {
248249
/**
249250
* a/b moved to a/c/b
@@ -253,7 +254,7 @@ public function fileMove($oldPath, $newPath) {
253254
* - a/c/ shared: add
254255
* - a/ shared: move/rename
255256
*/
256-
$this->moveCase = 'moveDown';
257+
$moveCase = 'moveDown';
257258
} else {
258259
/**
259260
* a/b/c moved to a/d/c
@@ -264,7 +265,7 @@ public function fileMove($oldPath, $newPath) {
264265
* - a/d/ shared: add
265266
* - a/ shared: move/rename
266267
*/
267-
$this->moveCase = 'moveCross';
268+
$moveCase = 'moveCross';
268269
}
269270

270271
[$this->oldParentPath, $this->oldParentOwner, $this->oldParentId] = $this->getSourcePathAndOwner($oldDir);
@@ -282,6 +283,7 @@ public function fileMove($oldPath, $newPath) {
282283
$oldAccessList['users'] = array_merge($oldAccessList['users'], $this->getAffectedUsersFromCachedMounts($oldFileId));
283284
}
284285

286+
$this->moveCase = $moveCase;
285287
$this->oldAccessList = $oldAccessList;
286288
}
287289

0 commit comments

Comments
 (0)