aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dashboard/lib/Service/BackgroundService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dashboard/lib/Service/BackgroundService.php')
-rw-r--r--apps/dashboard/lib/Service/BackgroundService.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/dashboard/lib/Service/BackgroundService.php b/apps/dashboard/lib/Service/BackgroundService.php
index 13ad03cf860..c98b92412cb 100644
--- a/apps/dashboard/lib/Service/BackgroundService.php
+++ b/apps/dashboard/lib/Service/BackgroundService.php
@@ -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'));
}