Skip to content

Commit

Permalink
Further restricting HTML content rejection for text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Aug 21, 2024
1 parent 1646aef commit f0fa559
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class TextFieldPanel extends FieldPanel<String> {

private static final long serialVersionUID = 1708195999215061362L;

private static final Pattern HTML_PATTERN = Pattern.compile("<(\"[^\"]*\"|'[^']*'|[^'\">])*>");
private static final Pattern HTML_PATTERN = Pattern.compile(".*<.*");

public TextFieldPanel(final String id, final String name, final IModel<String> model) {
super(id, name, model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public <T extends AnyTO> AnnotatedBeanPanel(final String id, final T anyTO) {
// ------------------------
// Last modifier
// ------------------------
add(new Label("lastModifier", new Model<>(anyTO.getLastModifier() != null
add(new Label("lastModifier", new Model<>(anyTO.getLastModifier() == null
? StringUtils.EMPTY : anyTO.getLastModifier())));
// ------------------------

Expand All @@ -72,7 +72,7 @@ public <T extends AnyTO> AnnotatedBeanPanel(final String id, final T anyTO) {
// ------------------------
// Last modifier
// ------------------------
add(new Label("lastChangeContext", new Model<>(anyTO.getLastChangeContext() != null
add(new Label("lastChangeContext", new Model<>(anyTO.getLastChangeContext() == null
? StringUtils.EMPTY : anyTO.getLastChangeContext())));
// ------------------------
}
Expand Down

0 comments on commit f0fa559

Please sign in to comment.