Explorar el Código

Fix generated avatars and nophoto cache files

Since nextcloud/server#19493 newFile() by default does not write the file anymore.
Setting an empty string as content will make it write the file immediate,
without having to call putContent() afterwards.

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v19.0.0beta1
Joas Schilling hace 4 años
padre
commit
f3a5bd6753
No account linked to committer's email address
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. 2
    2
      apps/dav/lib/CardDAV/PhotoCache.php
  2. 1
    1
      lib/private/Avatar/UserAvatar.php

+ 2
- 2
apps/dav/lib/CardDAV/PhotoCache.php Ver fichero

@@ -108,7 +108,7 @@ class PhotoCache {
$data = $this->getPhoto($card);

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

@@ -116,7 +116,7 @@ class PhotoCache {
$extension = self::ALLOWED_CONTENT_TYPES[$contentType] ?? null;

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


+ 1
- 1
lib/private/Avatar/UserAvatar.php Ver fichero

@@ -252,7 +252,7 @@ class UserAvatar extends Avatar {
$avatar->putContent($data);
$ext = 'png';

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


Cargando…
Cancelar
Guardar