mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-11-24 04:35:00 +00:00
improve sanitization
This commit is contained in:
parent
1802d91fad
commit
6e79310ef8
@ -95,7 +95,7 @@ public class SchematicDownloadEndpoint extends AbstractServlet
|
|||||||
Arrays.sort(alphabetical);
|
Arrays.sort(alphabetical);
|
||||||
for (File worldeditFile : alphabetical)
|
for (File worldeditFile : alphabetical)
|
||||||
{
|
{
|
||||||
String sanitizedName = worldeditFile.getName().replaceAll("<[^>]*>", "");
|
String sanitizedName = worldeditFile.getName().replaceAll("<","<").replaceAll(">",">");
|
||||||
sb.append("<tr>" +
|
sb.append("<tr>" +
|
||||||
"<th scope=\"row\"><a href=\"" + worldeditFile.getName() + "\" download>" + sanitizedName + "</a></th>" +
|
"<th scope=\"row\"><a href=\"" + worldeditFile.getName() + "\" download>" + sanitizedName + "</a></th>" +
|
||||||
"<td>" + formattedSize(worldeditFile.length()) + "</td>" +
|
"<td>" + formattedSize(worldeditFile.length()) + "</td>" +
|
||||||
|
Loading…
Reference in New Issue
Block a user