diff --git a/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java b/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java index aee71ac32ad..a258e4fedd3 100644 --- a/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java +++ b/appserver/admingui/common/src/main/java/org/glassfish/admingui/common/handlers/UtilHandlers.java @@ -37,7 +37,7 @@ * only if the new code is made subject to such option by the copyright * holder. */ -// Portions Copyright 2018-2022 Payara Foundation and/or affiliates +// Portions Copyright 2018-2024 Payara Foundation and/or affiliates /* * UtilHandlers.java @@ -1164,4 +1164,16 @@ public static String escapePropertyValue(String str){ } private static final String PATH_SEPARATOR = "${path.separator}"; + + @Handler(id = "gf.sanitiseProperty", + input = { + @HandlerInput(name = "systemProperty", type = String.class, required = true) + }, + output = { + @HandlerOutput(name = "result", type = String.class) + } + ) + public static void sanitiseProperty(HandlerContext handlerCtx) { + handlerCtx.setOutputValue("result", escapePropertyValue(((String)handlerCtx.getInputValue("systemProperty")))); + } } diff --git a/appserver/admingui/common/src/main/resources/configuration/sysInstanceValues.jsf b/appserver/admingui/common/src/main/resources/configuration/sysInstanceValues.jsf index b60e08bbd40..e88891fb328 100644 --- a/appserver/admingui/common/src/main/resources/configuration/sysInstanceValues.jsf +++ b/appserver/admingui/common/src/main/resources/configuration/sysInstanceValues.jsf @@ -38,7 +38,7 @@ only if the new code is made subject to such option by the copyright holder. - Portions Copyright [2020] [Payara Foundation and/or its affiliates] + Portions Copyright [2020-2024] [Payara Foundation and/or its affiliates] --> @@ -59,6 +60,8 @@ listAdd(value="#{pageSession.iiopListenerAttrs.data.extraProperties.entity['port']}" list="#{pageSession.iiopPortsList}"); } gf.resolveTokens(tokens="#{pageSession.iiopPortsList}" endPoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}" resolvedTokens="#{pageSession.iiopResolvedPortsList}"); - convertListToCommaString(list="#{pageSession.iiopResolvedPortsList}" commaString="#{pageSession.iiopPorts}"); + convertListToCommaString(list="#{pageSession.iiopResolvedPortsList}" commaString="#{iiopPorts}"); + gf.sanitiseProperty(systemProperty="#{iiopPorts}", result="#{pageSession.iiopPorts}"); + /> diff --git a/appserver/admingui/web/src/main/resources/serverPageNode.jsf b/appserver/admingui/web/src/main/resources/serverPageNode.jsf index ab6559143b8..eea135da593 100644 --- a/appserver/admingui/web/src/main/resources/serverPageNode.jsf +++ b/appserver/admingui/web/src/main/resources/serverPageNode.jsf @@ -38,7 +38,7 @@ only if the new code is made subject to such option by the copyright holder. - Portions Copyright [2018] [Payara Foundation and/or its affiliates] + Portions Copyright [2018-2024] [Payara Foundation and/or its affiliates] --> @@ -60,6 +60,7 @@ listAdd(value="#{pageSession.tmpPort}" list="#{pageSession.httpPortsList}"); } gf.resolveTokens(tokens="#{pageSession.httpPortsList}" endPoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}" resolvedTokens="#{pageSession.httpResolvedPortsList}"); - convertListToCommaString(list="#{pageSession.httpResolvedPortsList}" commaString="#{pageSession.httpPorts}"); + convertListToCommaString(list="#{pageSession.httpResolvedPortsList}" commaString="#{portList}"); + gf.sanitiseProperty(systemProperty="#{portList}", result="#{pageSession.httpPorts}"); />