diff options
author | Thomas <> | 2021-11-25 13:15:58 +0100 |
---|---|---|
committer | Thomas <> | 2021-11-25 13:15:58 +0100 |
commit | 01fcdf329b180108c31b1e809fedcf7e98ec34cc (patch) | |
tree | 2766fda49be015917d12ce469707a1b8f34aa6c8 /eaaf_core/src/main | |
parent | 3f824c2c20ce632d42950579e2a82afdaa8e2c18 (diff) | |
download | EAAF-Components-01fcdf329b180108c31b1e809fedcf7e98ec34cc.tar.gz EAAF-Components-01fcdf329b180108c31b1e809fedcf7e98ec34cc.tar.bz2 EAAF-Components-01fcdf329b180108c31b1e809fedcf7e98ec34cc.zip |
fix bug in GUI rendering that apply if messages contains a single quote
Diffstat (limited to 'eaaf_core/src/main')
-rw-r--r-- | eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java index 49acfadc..ca2c92b1 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/auth/services/ProtocolAuthenticationService.java @@ -497,18 +497,25 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer final IGuiBuilderConfiguration config = guiConfigFactory .getDefaultErrorGui(HttpUtils.extractAuthUrlFromRequest(httpReq)); + String[] errorCodeParams = null; if (params == null) { errorCodeParams = new String[] {}; + } else { errorCodeParams = new String[params.length]; for (int i = 0; i < params.length; i++) { if (params[i] != null) { - errorCodeParams[i] = params[i].toString(); + /* replace all single-quotes by two single-quotes for escaping purposes to mitigate + * Thymeleaf error in: + * th:text="${#messages.msgWithParams('__${msg.errorCode}__', '__${msg.errorParams}__')}" + */ + errorCodeParams[i] = params[i].toString().replaceAll("'", "''"); + } else { errorCodeParams[i] = "null"; + } - } } @@ -534,7 +541,7 @@ public class ProtocolAuthenticationService implements IProtocolAuthenticationSer } catch (final GuiBuildException e) { log.warn("Can not build error-message GUI.", e); - throw new EaafException("9199", null, e); + throw new EaafException("internal.99", new Object[] {e.getMessage()}, e); } |