mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
A plugin's name can now only contain: [A-Za-z0-9()\[\]{}_.-]
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
0d5f7ece8a
commit
434f054e38
@ -132,6 +132,10 @@ public final class PluginDescriptionFile {
|
|||||||
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
|
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
|
||||||
try {
|
try {
|
||||||
name = map.get("name").toString();
|
name = map.get("name").toString();
|
||||||
|
|
||||||
|
if (!name.matches("^[A-Za-z0-9()\\[\\]{}_.-]+$")) {
|
||||||
|
throw new InvalidDescriptionException("name '" + name + "' contains invalid characters.");
|
||||||
|
}
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException ex) {
|
||||||
throw new InvalidDescriptionException(ex, "name is not defined");
|
throw new InvalidDescriptionException(ex, "name is not defined");
|
||||||
} catch (ClassCastException ex) {
|
} catch (ClassCastException ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user