Skip to content

Commit

Permalink
LPS-117983 Escape structure name to avoid XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-savinov authored and brianchandotcom committed Jul 30, 2020
1 parent 2aed6ae commit c172c23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Expand Up @@ -44,6 +44,7 @@
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.ArrayUtil;
import com.liferay.portal.kernel.util.HashMapBuilder;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.util.WebKeys;
Expand Down Expand Up @@ -544,10 +545,11 @@ private CreationMenu _getCreationMenu() throws PortalException {
dropdownItem -> {
dropdownItem.setHref(portletURL);
dropdownItem.setLabel(
ddmStructure.getUnambiguousName(
ddmStructures,
_themeDisplay.getScopeGroupId(),
_themeDisplay.getLocale()));
HtmlUtil.escape(
ddmStructure.getUnambiguousName(
ddmStructures,
_themeDisplay.getScopeGroupId(),
_themeDisplay.getLocale())));
};

if (ArrayUtil.contains(
Expand Down
Expand Up @@ -53,7 +53,7 @@ SearchContainer<DDMStructure> ddmStructureSearch = journalSelectDDMStructureDisp
).put(
"ddmstructurekey", ddmStructure.getStructureKey()
).put(
"name", ddmStructure.getName(locale)
"name", HtmlUtil.escape(ddmStructure.getName(locale))
).build();
%>

Expand Down

0 comments on commit c172c23

Please sign in to comment.