From f0fa559c6c459eaa29f78ce12263c425f0763cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= Date: Wed, 21 Aug 2024 10:59:47 +0200 Subject: [PATCH] Further restricting HTML content rejection for text fields --- .../client/ui/commons/markup/html/form/TextFieldPanel.java | 2 +- .../client/console/wizards/any/AnnotatedBeanPanel.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/TextFieldPanel.java b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/TextFieldPanel.java index d328e0546f..eb219b3d57 100644 --- a/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/TextFieldPanel.java +++ b/client/idrepo/common-ui/src/main/java/org/apache/syncope/client/ui/commons/markup/html/form/TextFieldPanel.java @@ -28,7 +28,7 @@ public abstract class TextFieldPanel extends FieldPanel { 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 model) { super(id, name, model); diff --git a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnnotatedBeanPanel.java b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnnotatedBeanPanel.java index c9a232ac96..d4c84b78e4 100644 --- a/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnnotatedBeanPanel.java +++ b/client/idrepo/console/src/main/java/org/apache/syncope/client/console/wizards/any/AnnotatedBeanPanel.java @@ -58,7 +58,7 @@ public 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()))); // ------------------------ @@ -72,7 +72,7 @@ public 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()))); // ------------------------ }