mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
Merge pull request #32675 from nextcloud/fix/validate-dashboard-background
This commit is contained in:
commit
0523626b98
1 changed files with 4 additions and 0 deletions
|
|
@ -150,6 +150,10 @@ class BackgroundService {
|
|||
$userFolder = $this->rootFolder->getUserFolder($this->userId);
|
||||
/** @var File $file */
|
||||
$file = $userFolder->get($path);
|
||||
$image = new \OCP\Image();
|
||||
if ($image->loadFromFileHandle($file->fopen('r')) === false) {
|
||||
throw new InvalidArgumentException('Invalid image file');
|
||||
}
|
||||
$this->getAppDataFolder()->newFile('background.jpg', $file->fopen('r'));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue