Skip to content

Commit

Permalink
fix: login page doesn't display the correct localized characters
Browse files Browse the repository at this point in the history
oxAuth #1660
  • Loading branch information
yurem committed Jan 5, 2023
1 parent cdb5204 commit 884c1be
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.apache.commons.text.StringEscapeUtils;
import io.jans.service.el.ExpressionEvaluator;
import io.jans.util.StringHelper;

/**
* @author Yuriy Movchan
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 884c1be

Please sign in to comment.