mirror of
https://github.com/typecho/typecho.git
synced 2025-04-22 10:43:57 +02:00
fix: when setting CheckBox's default value to null [ref #1568]
This commit is contained in:
parent
0433a11c0a
commit
596d117210
@ -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);
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user