aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-08-21 12:01:44 +0200
committerGitHub <noreply@github.com>2024-08-21 12:01:44 +0200
commitc07cf51bebf4dcc90a522e0fc580365ca4ef02ef (patch)
treeb7528a19ed6170d11c0f9d42ef94c366ff197285 /lib
parent7fe62b9364315851fe7c7e851d94e02135bf4f00 (diff)
parentdbbe2bbcb7cc03420e90b93c357a9c560c4b367c (diff)
downloadnextcloud-server-c07cf51bebf4dcc90a522e0fc580365ca4ef02ef.tar.gz
nextcloud-server-c07cf51bebf4dcc90a522e0fc580365ca4ef02ef.zip
Merge pull request #47380 from nextcloud/bugfix/noid/make-logo-dimension-more-save
fix(theming): Make getImage() call save against missing non-SVG version
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Repair/RepairLogoDimension.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/private/Repair/RepairLogoDimension.php b/lib/private/Repair/RepairLogoDimension.php
index 122da205986..854aeb3ab07 100644
--- a/lib/private/Repair/RepairLogoDimension.php
+++ b/lib/private/Repair/RepairLogoDimension.php
@@ -9,6 +9,8 @@ declare(strict_types=1);
namespace OC\Repair;
use OCA\Theming\ImageManager;
+use OCP\Files\NotFoundException;
+use OCP\Files\NotPermittedException;
use OCP\IConfig;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
@@ -44,9 +46,18 @@ class RepairLogoDimension implements IRepairStep {
return;
}
- $simpleFile = $imageManager->getImage('logo', false);
-
- $image = @imagecreatefromstring($simpleFile->getContent());
+ try {
+ try {
+ $simpleFile = $imageManager->getImage('logo', false);
+ $image = @imagecreatefromstring($simpleFile->getContent());
+ } catch (NotFoundException|NotPermittedException) {
+ $simpleFile = $imageManager->getImage('logo');
+ $image = false;
+ }
+ } catch (NotFoundException|NotPermittedException) {
+ $output->info('Theming is not used to provide a logo');
+ return;
+ }
$dimensions = '';
if ($image !== false) {