Commit 39817de3 by Qiang Xue

Ensure correct type.

parent 3d10cb18
...@@ -553,7 +553,7 @@ class HtmlBase ...@@ -553,7 +553,7 @@ class HtmlBase
*/ */
public static function radio($name, $checked = false, $options = array()) public static function radio($name, $checked = false, $options = array())
{ {
$options['checked'] = $checked; $options['checked'] = (boolean)$checked;
$value = array_key_exists('value', $options) ? $options['value'] : '1'; $value = array_key_exists('value', $options) ? $options['value'] : '1';
if (isset($options['uncheck'])) { if (isset($options['uncheck'])) {
// add a hidden field so that if the radio button is not selected, it still submits a value // add a hidden field so that if the radio button is not selected, it still submits a value
...@@ -582,7 +582,7 @@ class HtmlBase ...@@ -582,7 +582,7 @@ class HtmlBase
*/ */
public static function checkbox($name, $checked = false, $options = array()) public static function checkbox($name, $checked = false, $options = array())
{ {
$options['checked'] = $checked; $options['checked'] = (boolean)$checked;
$value = array_key_exists('value', $options) ? $options['value'] : '1'; $value = array_key_exists('value', $options) ? $options['value'] : '1';
if (isset($options['uncheck'])) { if (isset($options['uncheck'])) {
// add a hidden field so that if the checkbox is not selected, it still submits a value // add a hidden field so that if the checkbox is not selected, it still submits a value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment