Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 13865cb7ac86cb4cc2f98732888d5426351c8bb3 1 parent ee7d2c3
Simon Welsh authored

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  forms/FormField.php
4  forms/FormField.php
@@ -374,7 +374,9 @@ function getAttributesHTML($attrs = null) {
374 374
 		if(!$attrs || is_string($attrs)) $attrs = $this->getAttributes();
375 375
 
376 376
 		// Remove empty
377  
-		$attrs = array_filter((array)$attrs, create_function('$v', 'return ($v || $v === 0);')); ; 
  377
+		$attrs = array_filter((array)$attrs, function($v) {
  378
+			return ($v || $v === 0 || $v === '0');
  379
+		}); 
378 380
 
379 381
 		// Remove excluded
380 382
 		if($exclude) $attrs = array_diff_key($attrs, array_flip($exclude));

0 notes on commit 13865cb

Please sign in to comment.
Something went wrong with that request. Please try again.