Permalink
Browse files

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

  • Loading branch information...
1 parent ee7d2c3 commit 13865cb7ac86cb4cc2f98732888d5426351c8bb3 @simonwelsh simonwelsh committed Apr 20, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 forms/FormField.php
View
@@ -374,7 +374,9 @@ function getAttributesHTML($attrs = null) {
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));

0 comments on commit 13865cb

Please sign in to comment.