mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 18:28:08 +01:00
fix(theming): Make getImage() call save against missing non-SVG version
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user