diff --git a/install.php b/install.php index 32e5bb75..ae9cdf9a 100644 --- a/install.php +++ b/install.php @@ -1031,8 +1031,7 @@ function install_step_2_perform() ->addRule('dbFile', 'required', _t('确认您的配置')) ->addRule('dbFile', function (string $path) { $pattern = "/^(\/[._a-z0-9-]+)*[a-z0-9]+\.[a-z0-9]{2,}$/i"; - if (strstr(PHP_OS, 'WIN')) - { + if (strstr(PHP_OS, 'WIN')) { $pattern = "/(\/[._a-z0-9-]+)*[a-z0-9]+\.[a-z0-9]{2,}$/i"; } return !!preg_match($pattern, $path); diff --git a/var/Typecho/Widget/Helper/Form/Element/Checkbox.php b/var/Typecho/Widget/Helper/Form/Element/Checkbox.php index 15353975..b931d692 100644 --- a/var/Typecho/Widget/Helper/Form/Element/Checkbox.php +++ b/var/Typecho/Widget/Helper/Form/Element/Checkbox.php @@ -61,7 +61,7 @@ class Checkbox extends Element */ protected function inputValue($value) { - $values = is_array($value) ? $value : [$value]; + $values = is_null($value) ? [] : (is_array($value) ? $value : [$value]); foreach ($this->options as $option) { $option->removeAttribute('checked');