diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2022-06-28 18:02:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-28 18:02:26 +0300 |
commit | 64d163bcbfcbb89c32fd73477f28da6bce2f3e48 (patch) | |
tree | b614996a156e3e46162264890342be04495095b0 | |
parent | a849c3d44455c7100b6a6392bb9287886a1c3fff (diff) | |
parent | 59ca7931e1175002d58392ebe3a992bdf7dbe295 (diff) |
Merge pull request #32791 from nextcloud/backport/32675/stable24
[stable24] Validate custom dashboard background image
-rw-r--r-- | apps/dashboard/lib/Service/BackgroundService.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/dashboard/lib/Service/BackgroundService.php b/apps/dashboard/lib/Service/BackgroundService.php index f9bd987bdca..0619fd8d304 100644 --- a/apps/dashboard/lib/Service/BackgroundService.php +++ b/apps/dashboard/lib/Service/BackgroundService.php @@ -149,6 +149,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')); } |