Skip to content

Commit 5ca8331

Browse files
mxs2brianchandotcom
authored andcommitted
LPD-55453 Escape Parameter URL in RenderStructureFieldMVCResourceCommand
1 parent 7f4a042 commit 5ca8331

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/apps/dynamic-data-mapping/dynamic-data-mapping-web/src/main/java/com/liferay/dynamic/data/mapping/web/internal/portlet/action/RenderStructureFieldMVCResourceCommand.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.liferay.portal.kernel.servlet.ServletResponseUtil;
2020
import com.liferay.portal.kernel.theme.ThemeDisplay;
2121
import com.liferay.portal.kernel.util.ContentTypes;
22+
import com.liferay.portal.kernel.util.HtmlUtil;
2223
import com.liferay.portal.kernel.util.ParamUtil;
2324
import com.liferay.portal.kernel.util.Portal;
2425
import com.liferay.portal.kernel.util.Validator;
@@ -91,8 +92,8 @@ private DDMFormFieldRenderingContext _createDDMFormFieldRenderingContext(
9192
httpServletRequest.setAttribute(WebKeys.PORTLET_ID, portletId);
9293
}
9394

94-
String portletNamespace = ParamUtil.getString(
95-
httpServletRequest, "portletNamespace");
95+
String portletNamespace = HtmlUtil.escapeAttribute(
96+
ParamUtil.getString(httpServletRequest, "portletNamespace"));
9697

9798
httpServletRequest.setAttribute(
9899
"aui:form:portletNamespace", portletNamespace);
@@ -111,7 +112,8 @@ private DDMFormFieldRenderingContext _createDDMFormFieldRenderingContext(
111112
ddmFormFieldRenderingContext.setMode(
112113
ParamUtil.getString(httpServletRequest, "mode"));
113114
ddmFormFieldRenderingContext.setNamespace(
114-
ParamUtil.getString(httpServletRequest, "namespace"));
115+
HtmlUtil.escapeAttribute(
116+
ParamUtil.getString(httpServletRequest, "namespace")));
115117
ddmFormFieldRenderingContext.setPortletNamespace(portletNamespace);
116118
ddmFormFieldRenderingContext.setReadOnly(
117119
ParamUtil.getBoolean(httpServletRequest, "readOnly"));

0 commit comments

Comments
 (0)