mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
Trims input value
This commit is contained in:
@@ -55,7 +55,7 @@ public class URLValidator extends FieldValidatorSupport {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(value.getClass().equals(String.class)) || !Pattern.compile(getUrlRegex(), Pattern.CASE_INSENSITIVE).matcher(String.valueOf(value)).matches()) {
|
||||
if (!(value.getClass().equals(String.class)) || !Pattern.compile(getUrlRegex(), Pattern.CASE_INSENSITIVE).matcher(String.valueOf(value).trim()).matches()) {
|
||||
addFieldError(fieldName, object);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user