Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 13865cb7ac86cb4cc2f98732888d5426351c8bb3 1 parent ee7d2c3
@simonwelsh simonwelsh 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.