BUGFIX Don't filter out attributes that are '0'

This commit is contained in:
Simon Welsh 2012-04-20 12:22:40 +12:00
parent ee7d2c3086
commit 13865cb7ac

View File

@ -374,7 +374,9 @@ class FormField extends RequestHandler {
if(!$attrs || is_string($attrs)) $attrs = $this->getAttributes();
// Remove empty
$attrs = array_filter((array)$attrs, create_function('$v', 'return ($v || $v === 0);')); ;
$attrs = array_filter((array)$attrs, function($v) {
return ($v || $v === 0 || $v === '0');
});
// Remove excluded
if($exclude) $attrs = array_diff_key($attrs, array_flip($exclude));