Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-06-09 18:56:48 +0300
committerGitHub <noreply@github.com>2022-06-09 18:56:48 +0300
commit0523626b98ea356842b0c49e63808b300bb2096d (patch)
tree8fbf37208c09e1a11694b084f4d8564edc518d26 /apps
parent76db612b16380b20a3203bc0d3964733a6c1a587 (diff)
parent00135986ab79e7fb15dc642b5308e62608d0ea59 (diff)
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'));
}