Skip to content

Commit 9f9c8b9

Browse files
committed
0.7.4.10 (2021-01-31)
-------------------- + Correct optional message in ValidatorRegex
1 parent 08196c4 commit 9f9c8b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fj-core/src/main/java/org/fugerit/java/core/validator/ValidatorRegex.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void configure( Properties atts ) throws ConfigException {
4343
@Override
4444
public boolean validate(ValidatorContext context) throws Exception {
4545
boolean valid = super.validate(context);
46-
if ( this.isRequired() && StringUtils.isNotEmpty( context.getValue() ) ) {
46+
if ( this.isRequired() || StringUtils.isNotEmpty( context.getValue() ) ) {
4747
if ( !Pattern.matches( this.getRegex() , context.getValue() ) ) {
4848
valid = false;
4949
String message = this.formatMessage( context.getBundle() , ERROR_KEY_REGEX, context.getLabel(), context.getValue(), StringUtils.valueWithDefault( this.getInfo(), this.getRegex() ) );

0 commit comments

Comments
 (0)