mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #355 from simonwelsh/patch-2
BUGFIX Don't filter out attributes that are '0'
This commit is contained in:
commit
f1249e66a3
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user