diff options
author | Aleksander Machniak <alec@alec.pl> | 2022-01-08 10:32:34 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2022-01-08 10:32:34 +0300 |
commit | 751abb611944fbd6b73a01e60df09bba853fdf02 (patch) | |
tree | aad00b9538dcb1dc4193e2f79ba2cdd7870a68c4 | |
parent | 8bd31c54218971da24e6e9ba268dfb16feef1829 (diff) |
Fix PHP Warning: Undefined array key "value" on PHP8 (#8382)
-rw-r--r-- | program/lib/Roundcube/html.php | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php index 82b364cad..cec991135 100644 --- a/program/lib/Roundcube/html.php +++ b/program/lib/Roundcube/html.php @@ -518,14 +518,14 @@ class html_hiddenfield extends html } /** - * Class to create HTML radio buttons + * Class to create HTML checkboxes * * @package Framework * @subpackage View */ -class html_radiobutton extends html_inputfield +class html_checkbox extends html_inputfield { - protected $type = 'radio'; + protected $type = 'checkbox'; /** * Get HTML code for this object @@ -543,42 +543,21 @@ class html_radiobutton extends html_inputfield } // set value attribute - $this->attrib['checked'] = ((string)$value == (string)$this->attrib['value']); + $this->attrib['checked'] = isset($this->attrib['value']) && ((string)$value == (string)$this->attrib['value']); return parent::show(); } } /** - * Class to create HTML checkboxes + * Class to create HTML radio buttons * * @package Framework * @subpackage View */ -class html_checkbox extends html_inputfield +class html_radiobutton extends html_checkbox { - protected $type = 'checkbox'; - - /** - * Get HTML code for this object - * - * @param string $value Value of the checked field - * @param array $attrib Additional attributes to override - * - * @return string HTML output - */ - public function show($value = '', $attrib = null) - { - // overwrite object attributes - if (is_array($attrib)) { - $this->attrib = array_merge($this->attrib, $attrib); - } - - // set value attribute - $this->attrib['checked'] = ((string)$value == (string)$this->attrib['value']); - - return parent::show(); - } + protected $type = 'radio'; } /** @@ -746,7 +725,6 @@ class html_select extends html } } - /** * Class to build an HTML table * |