Ensure correct type.

This commit is contained in:
Qiang Xue
2013-07-24 08:02:19 -04:00
parent 3d10cb1852
commit 39817de330

View File

@ -553,7 +553,7 @@ class HtmlBase
*/
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';
if (isset($options['uncheck'])) {
// add a hidden field so that if the radio button is not selected, it still submits a value
@ -582,7 +582,7 @@ class HtmlBase
*/
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';
if (isset($options['uncheck'])) {
// add a hidden field so that if the checkbox is not selected, it still submits a value