From e03b1aeb169c95eeef54dd4a037cc65835072fa3 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 7 Apr 2021 13:12:19 +0200 Subject: [PATCH] fix PHP 8 error: key() Argument #1 must be of type array, null given --- api/src/Etemplate/Widget/Vfs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Etemplate/Widget/Vfs.php b/api/src/Etemplate/Widget/Vfs.php index ee94a21ced..9781da9ad7 100644 --- a/api/src/Etemplate/Widget/Vfs.php +++ b/api/src/Etemplate/Widget/Vfs.php @@ -409,7 +409,7 @@ class Vfs extends File $response = Json\Response::get(); $readonlys = $sel_options = array(); - if (isset($params['mime'])) + if (!empty($params['mime'])) { foreach((array)$params['mime'] as $key => $value) { @@ -441,7 +441,7 @@ class Vfs extends File { throw new Api\Exception\WrongParameter("Wrong or unset required mode parameter!"); } - if (isset($params['mime'])) + if (!empty($params['mime'])) { $content['showmime'] = true; $content['mime'] = key($sel_options['mime']);