Skip to content

Commit

Permalink
Fix: Assertion failure in DelayedPhotoLoader (Fixes: #404)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstilkerich committed Oct 22, 2022
1 parent ea42a06 commit 091e056
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fix: When setting CardDAV addressbooks for collected recipients/senders from the admin configuration, setting them as
`dont_override` is a mandatory action for the admin, otherwise the setting might get overridden by user preferences in
conjunction with the use of other plugins (that are completely unrelated to these addressbooks). (Fixes #391)
- Fix: Assertion failure in DelayedPhotoLoader (Fixes: #404)

## Version 4.4.3 (to 4.4.2)

Expand Down
8 changes: 6 additions & 2 deletions src/DelayedPhotoLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,12 @@ private function storeToRoundcubeCache(string $photoData, VObject\Property $phot
private function determineCacheKey(): string
{
$uid = (string) $this->vcard->UID;
$userid = $_SESSION['user_id'];
assert(is_string($userid), "user must be logged on to use photo cache");

if (!isset($_SESSION['user_id'])) {
throw new \Exception("determineCacheKey: user must be logged on to use photo cache");
}

$userid = (string) $_SESSION['user_id'];

$key = "photo_";
$key .= $userid . "_" ;
Expand Down

0 comments on commit 091e056

Please sign in to comment.