Skip to content

Commit

Permalink
Merge pull request #20145 from nextcloud/bugfix/noid/generated-avatar…
Browse files Browse the repository at this point in the history
…s-and-nophoto-cache

Fix generated avatars and nophoto cache files
  • Loading branch information
blizzz authored Mar 25, 2020
2 parents 3427653 + f3a5bd6 commit ba14c41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/dav/lib/CardDAV/PhotoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ private function init(ISimpleFolder $folder, Card $card): void {
$data = $this->getPhoto($card);

if ($data === false || !isset($data['Content-Type'])) {
$folder->newFile('nophoto');
$folder->newFile('nophoto', '');
return;
}

$contentType = $data['Content-Type'];
$extension = self::ALLOWED_CONTENT_TYPES[$contentType] ?? null;

if ($extension === null) {
$folder->newFile('nophoto');
$folder->newFile('nophoto', '');
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Avatar/UserAvatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function getFile($size) {
$avatar->putContent($data);
$ext = 'png';

$this->folder->newFile('generated');
$this->folder->newFile('generated', '');
$this->config->setUserValue($this->user->getUID(), 'avatar', 'generated', 'true');
}

Expand Down

0 comments on commit ba14c41

Please sign in to comment.