escape occurrences of short id

hotfix/0.8.7
Zlatin Balevsky 2021-07-06 20:37:23 +01:00
parent c3e1a8faad
commit accf8301ad
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@ String pagetitle=Util._t("About Me");
String helptext = Util._t("This page shows information about your MuWire identity."); String helptext = Util._t("This page shows information about your MuWire identity.");
Core core = (Core) application.getAttribute("core"); Core core = (Core) application.getAttribute("core");
String shortId = Util.escapeHTMLinXML(core.getMe().getHumanReadableName());
%> %>
@ -36,7 +37,7 @@ openAccordion = 3;
</aside> </aside>
<section class="main foldermain"> <section class="main foldermain">
<h3><%=Util._t("MuWire ID")%></h3> <h3><%=Util._t("MuWire ID")%></h3>
<p><%=Util._t("Your short MuWire ID: {0}", core.getMe().getHumanReadableName())%></p> <p><%=Util._t("Your short MuWire ID: {0}", shortId)%></p>
<p><%=Util._t("Your full MuWire ID:")%></p> <p><%=Util._t("Your full MuWire ID:")%></p>
<p><textarea class="fullId" id="full-id" readonly><%=core.getMe().toBase64()%></textarea></p> <p><textarea class="fullId" id="full-id" readonly><%=core.getMe().toBase64()%></textarea></p>
<p><a href='#' onclick="window.copyFullId();return false;"><%=Util._t("Copy to clipboard")%></a></p> <p><a href='#' onclick="window.copyFullId();return false;"><%=Util._t("Copy to clipboard")%></a></p>

View File

@ -14,7 +14,7 @@ String helptext = Util._t("Use this page to browse the files shared by other MuW
String currentBrowse = null; String currentBrowse = null;
if (request.getParameter("currentHost") != null) { if (request.getParameter("currentHost") != null) {
Persona host = new Persona(new ByteArrayInputStream(Base64.decode(request.getParameter("currentHost")))); Persona host = new Persona(new ByteArrayInputStream(Base64.decode(request.getParameter("currentHost"))));
currentBrowse = host.getHumanReadableName(); currentBrowse = Util.escapeHTMLinXML(host.getHumanReadableName());
} }
%> %>