修复 select 生成在 php8 环境中的报错

(cherry picked from commit 7fe625cf5b)
pull/460/head
F4nniu 2023-07-25 18:27:20 +08:00
parent e3779a1f05
commit 2e4fe16f44
1 changed files with 2 additions and 2 deletions

View File

@ -18,8 +18,8 @@ if (!function_exists('build_select')) {
*/
function build_select($name, $options, $selected = [], $attr = [])
{
$options = is_array($options) ? $options : explode(',', $options);
$selected = is_array($selected) ? $selected : explode(',', $selected);
$options = is_array($options) ? $options : explode(',', $options ?? '');
$selected = is_array($selected) ? $selected : explode(',', $selected ?? '');
return Form::select($name, $options, $selected, $attr);
}
}