aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-06-09 08:56:48 -0700
committerGitHub <noreply@github.com>2022-06-09 08:56:48 -0700
commit0523626b98ea356842b0c49e63808b300bb2096d (patch)
tree8fbf37208c09e1a11694b084f4d8564edc518d26 /apps
parent76db612b16380b20a3203bc0d3964733a6c1a587 (diff)
parent00135986ab79e7fb15dc642b5308e62608d0ea59 (diff)
downloadnextcloud-server-0523626b98ea356842b0c49e63808b300bb2096d.tar.gz
nextcloud-server-0523626b98ea356842b0c49e63808b300bb2096d.zip
Merge pull request #32675 from nextcloud/fix/validate-dashboard-background
Diffstat (limited to 'apps')
-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'));
}