Fix checkboxes using defaults not returning boolean

This commit is contained in:
Nathan Gray 2013-06-24 23:03:55 +00:00
parent 80ae80098e
commit a05ac6fa11

View File

@ -61,8 +61,8 @@ class etemplate_widget_checkbox extends etemplate_widget
// defaults for set and unset values
if (!$this->attrs['set_val'] && !$this->attrs['unset_val'])
{
$set_val = 'true';
$unset_val = 'false';
$set_val = true;
$unset_val = false;
}
else
{
@ -92,6 +92,11 @@ class etemplate_widget_checkbox extends etemplate_widget
{
if (!isset($valid)) $valid = array();
}
elseif ($value === 'true')
{
// 'true' != true
$valid = $set_val;
}
else
{
$valid = $unset_val;