mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-11-23 20:25:00 +00:00
uhhhh
uhhhhhh 😳
This commit is contained in:
parent
2117cf7041
commit
f8bd688fa5
@ -15,7 +15,6 @@ import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.CharacterIterator;
|
||||
import java.text.StringCharacterIterator;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.Data;
|
||||
|
@ -28,7 +28,7 @@ public class SchematicUploadServlet extends HttpServlet
|
||||
return;
|
||||
}
|
||||
File[] schematics = worldeditFolder.listFiles();
|
||||
Part uploadPart = null;
|
||||
Part uploadPart;
|
||||
try
|
||||
{
|
||||
uploadPart = req.getPart("file");
|
||||
@ -39,8 +39,11 @@ public class SchematicUploadServlet extends HttpServlet
|
||||
return;
|
||||
}
|
||||
String filename = uploadPart.getSubmittedFileName().replaceAll("[^a-zA-Z0-9'!,_ .-]", "_");
|
||||
if (schemNameMatcher.matcher(filename).matches())
|
||||
if (!schemNameMatcher.matcher(filename).matches())
|
||||
{
|
||||
resp.getWriter().println(schematicUploadBadHTML("That is not a valid schematic filename!"));
|
||||
return;
|
||||
}
|
||||
boolean alreadyExists = schematics != null && Arrays.stream(schematics).anyMatch(file -> HTTPDModule.fileNameEquals(file.getName(), filename));
|
||||
if (alreadyExists)
|
||||
{
|
||||
@ -52,7 +55,6 @@ public class SchematicUploadServlet extends HttpServlet
|
||||
inputStream.close();
|
||||
resp.getWriter().println(schematicUploadGoodHTML("Successfully uploaded <b>" + filename + "."));
|
||||
}
|
||||
}
|
||||
|
||||
private String schematicUploadBadHTML(String message)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user