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
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-06-28 18:02:26 +0300
committerGitHub <noreply@github.com>2022-06-28 18:02:26 +0300
commit64d163bcbfcbb89c32fd73477f28da6bce2f3e48 (patch)
treeb614996a156e3e46162264890342be04495095b0
parenta849c3d44455c7100b6a6392bb9287886a1c3fff (diff)
parent59ca7931e1175002d58392ebe3a992bdf7dbe295 (diff)
Merge pull request #32791 from nextcloud/backport/32675/stable24
[stable24] Validate custom dashboard background image
-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 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'));
}