Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #355 from simonwelsh/patch-2

BUGFIX Don't filter out attributes that are '0'
  • Loading branch information...
commit f1249e66a31c2156ed49c6f74ac0ad7396d29861 2 parents ee7d2c3 + 13865cb
@halkyon halkyon authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 forms/FormField.php
View
4 forms/FormField.php
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.