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>
$data = $this->getPhoto($card);
if ($data === false || !isset($data['Content-Type'])) {
- $folder->newFile('nophoto');
+ $folder->newFile('nophoto', '');
return;
}
$extension = self::ALLOWED_CONTENT_TYPES[$contentType] ?? null;
if ($extension === null) {
- $folder->newFile('nophoto');
+ $folder->newFile('nophoto', '');
return;
}
$avatar->putContent($data);
$ext = 'png';
- $this->folder->newFile('generated');
+ $this->folder->newFile('generated', '');
$this->config->setUserValue($this->user->getUID(), 'avatar', 'generated', 'true');
}