Skip to content

Commit

Permalink
Text validations were being tested in input, not value!
Browse files Browse the repository at this point in the history
This means that any defined transform or deflation could not alter the
value to something that would validate.
  • Loading branch information
karenetheridge committed Oct 15, 2016
1 parent b0fa47f commit c82f3ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

Fixed Text validation checking, to allow deflations and transformations
to be applied first.

0.40066 Mon Jul 18, 2016
Improve Select field option list support
Support arrayref-of-arrayref options in a subroutine
Expand Down
2 changes: 1 addition & 1 deletion lib/HTML/FormHandler/Field/Text.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sub validate {
my $field = shift;

return unless $field->next::method;
my $value = $field->input;
my $value = $field->value;
# Check for max length
if ( my $maxlength = $field->maxlength ) {
return $field->add_error( $field->get_message('text_maxlength'),
Expand Down

0 comments on commit c82f3ec

Please sign in to comment.