From 395b3769750d2d32f624060c0b6e6ceeee7df0be Mon Sep 17 00:00:00 2001 From: Yuriy Movchan Date: Fri, 6 Jan 2023 13:53:33 +0300 Subject: [PATCH] fix: login page doesn't display the correct localized characters (#3528) oxAuth #1660 --- .../main/java/io/jans/jsf2/message/FacesMessages.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/jans-core/jsf-util/src/main/java/io/jans/jsf2/message/FacesMessages.java b/jans-core/jsf-util/src/main/java/io/jans/jsf2/message/FacesMessages.java index dc8d9c25e89..0c29569a2fe 100644 --- a/jans-core/jsf-util/src/main/java/io/jans/jsf2/message/FacesMessages.java +++ b/jans-core/jsf-util/src/main/java/io/jans/jsf2/message/FacesMessages.java @@ -24,6 +24,7 @@ import org.apache.commons.text.StringEscapeUtils; import io.jans.service.el.ExpressionEvaluator; +import io.jans.util.StringHelper; /** * @author Yuriy Movchan @@ -55,12 +56,20 @@ public void add(Severity severity, String message) { } public void add(String clientId, Severity severity, String message) { + boolean escape = StringHelper.isNotEmpty(clientId); + add(clientId, severity, message, escape); + } + + public void add(String clientId, Severity severity, String message, boolean escape) { if (facesContext == null) { return; } String evaluatedMessage = evalAsString(message); - String encodedMessage = StringEscapeUtils.escapeHtml4(evaluatedMessage); + String encodedMessage = evaluatedMessage; + if (escape) { + encodedMessage = StringEscapeUtils.escapeHtml4(evaluatedMessage); + } FacesMessage facesMessage = new FacesMessage(severity, encodedMessage, encodedMessage); facesContext.addMessage(clientId, facesMessage);