Theming: Check valid image format also for logo
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
c337c8fa45
commit
c0d104087b
1 changed files with 12 additions and 0 deletions
|
@ -248,6 +248,18 @@ class ThemingController extends Controller {
|
|||
|
||||
if (!empty($newLogo)) {
|
||||
$target = $folder->newFile('logo');
|
||||
$supportedFormats = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml', 'text/svg'];
|
||||
if (!in_array($newLogo['type'], $supportedFormats)) {
|
||||
return new DataResponse(
|
||||
[
|
||||
'data' => [
|
||||
'message' => $this->l10n->t('Unsupported image type'),
|
||||
],
|
||||
'status' => 'failure',
|
||||
],
|
||||
Http::STATUS_UNPROCESSABLE_ENTITY
|
||||
);
|
||||
}
|
||||
$target->putContent(file_get_contents($newLogo['tmp_name'], 'r'));
|
||||
$this->themingDefaults->set('logoMime', $newLogo['type']);
|
||||
$name = $newLogo['name'];
|
||||
|
|
Loading…
Reference in a new issue