Skip to content

Commit

Permalink
fix(FaceRoot#getChild): Validate detection matches cluster
Browse files Browse the repository at this point in the history
fixes #1073

Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Jan 9, 2024
1 parent 02f486c commit fb26826
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/Dav/Faces/FaceRoot.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public function getChild($name): FacePhoto {
} catch (DoesNotExistException $e) {
throw new NotFound();
}
if ($detection->getClusterId() !== $this->cluster->getId()) {
throw new NotFound();
}
return new FacePhoto($this->detectionMapper, $detection, $this->rootFolder->getUserFolder($this->user->getUID()), $this->tagManager, $this->previewManager);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/FaceDetection.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @method setHeight(float $height)
* @method setWidth(float $width)
* @method setClusterId(int|null $clusterId)
* @method ?int getClusterId()
* @method int|null getClusterId()
* @method float getThreshold()
* @method setThreshold(float $threshold)
*/
Expand Down

0 comments on commit fb26826

Please sign in to comment.