Ignore non-scalar values for length.

Fixes #3159
This commit is contained in:
mark_story 2012-08-28 21:58:32 -04:00
parent f97d8f9bb7
commit 4fdd5e5d45

View file

@ -1005,7 +1005,11 @@ class FormHelper extends AppHelper {
}
}
$autoLength = (!array_key_exists('maxlength', $options) && isset($fieldDef['length']));
$autoLength = (
!array_key_exists('maxlength', $options) &&
isset($fieldDef['length']) &&
is_scalar($fieldDef['length'])
);
if ($autoLength && $options['type'] == 'text') {
$options['maxlength'] = $fieldDef['length'];
}