Skip to content

Commit

Permalink
Fix #10476: Logic incorrect for minimum length of custom field string
Browse files Browse the repository at this point in the history
A string which is equal in length to the minimum allowed should be
accepted. Thanks to Striker for this patch.
  • Loading branch information
davidhicks committed Oct 29, 2009
1 parent bcbdc07 commit 7ab8078
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/custom_field_api.php
Expand Up @@ -1151,7 +1151,7 @@ function custom_field_validate( $p_field_id, $p_value ) {
$t_valid &= preg_match( "/$t_valid_regexp/", $p_value );
}
// check string length
$t_valid &= ( 0 == $t_length_min ) || ( $t_length > $t_length_min );
$t_valid &= ( 0 == $t_length_min ) || ( $t_length >= $t_length_min );
$t_valid &= ( 0 == $t_length_max ) || ( $t_length <= $t_length_max );
break;
case CUSTOM_FIELD_TYPE_NUMERIC:
Expand Down

0 comments on commit 7ab8078

Please sign in to comment.