Fixed escape of software name.

This commit is contained in:
Christian P. MOMON 2020-11-26 06:46:57 +01:00
parent 76db3f72cd
commit 481dfce2d5
3 changed files with 7 additions and 6 deletions

View file

@ -21,6 +21,7 @@ package fr.devinsy.statoolinfos.htmlize;
import java.util.ArrayList; import java.util.ArrayList;
import fr.devinsy.strings.StringList; import fr.devinsy.strings.StringList;
import fr.devinsy.xidyn.utils.XidynUtils;
/** /**
* The Class BreadcrumbTrail. * The Class BreadcrumbTrail.
@ -87,7 +88,7 @@ public class BreadcrumbTrail extends ArrayList<Breadcrumb>
for (Breadcrumb crumb : this) for (Breadcrumb crumb : this)
{ {
buffer.append(String.format("<a href=\"%s\" style=\"text-decoration: none; padding: 5px;\">%s</a>", crumb.getLink(), crumb.getLabel())); buffer.append(String.format("<a href=\"%s\" style=\"text-decoration: none; padding: 5px;\">%s</a>", crumb.getLink(), XidynUtils.escapeXmlBlank(crumb.getLabel())));
buffer.append(" > "); buffer.append(" > ");
} }
if (buffer.size() > 2) if (buffer.size() > 2)

View file

@ -117,7 +117,7 @@ public class ServicePage
data.setEscapedContent("serviceURL", service.getWebsite()); data.setEscapedContent("serviceURL", service.getWebsite());
data.setEscapedAttribute("serviceURL", "href", service.getWebsite()); data.setEscapedAttribute("serviceURL", "href", service.getWebsite());
data.setContent("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a")); data.setEscapedContent("serviceDescription", StringUtils.defaultIfBlank(service.getDescription(), "n/a"));
data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a")); data.setContent("serviceStartDate", StringUtils.defaultIfBlank(service.getStartDate(), "n/a"));
data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a")); data.setContent("serviceEndDate", StringUtils.defaultIfBlank(service.getEndDate(), "n/a"));
@ -183,9 +183,9 @@ public class ServicePage
} }
// //
data.setContent("softwareName", StringUtils.defaultIfBlank(service.getSoftwareName(), "n/a")); data.setEscapedContent("softwareName", StringUtils.defaultIfBlank(service.getSoftwareName(), "n/a"));
data.setContent("softwareVersion", StringUtils.defaultIfBlank(service.getSoftwareVersion(), "n/a")); data.setContent("softwareVersion", StringUtils.defaultIfBlank(service.getSoftwareVersion(), "n/a"));
data.setContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a")); data.setEscapedContent("softwareLicenseName", StringUtils.defaultIfBlank(service.getSoftwareLicenseName(), "n/a"));
if (StringUtils.isNotBlank(service.getSoftwareWebsite())) if (StringUtils.isNotBlank(service.getSoftwareWebsite()))
{ {
data.setEscapedAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite()); data.setEscapedAttribute("softwareWebsiteLink", "href", service.getSoftwareWebsite());

View file

@ -85,8 +85,8 @@ public class SoftwarePage
TagDataManager data = new TagDataManager(); TagDataManager data = new TagDataManager();
data.setContent("softwareName", software.getName()); data.setEscapedContent("softwareName", software.getName());
data.setContent("softwareDesciprtion", software.getDescription()); data.setEscapedContent("softwareDescription", software.getDescription());
data.setContent("serviceCount", services.size()); data.setContent("serviceCount", services.size());
data.setContent("serviceListView", ServiceListView.build(services)); data.setContent("serviceListView", ServiceListView.build(services));