mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
A plugin's name can now only contain: [A-Za-z0-9()\[\]{}_.-]
This commit is contained in:
parent
5fd890208f
commit
d2d7ea50eb
1 changed files with 4 additions and 0 deletions
|
@ -132,6 +132,10 @@ public final class PluginDescriptionFile {
|
|||
private void loadMap(Map<String, Object> map) throws InvalidDescriptionException {
|
||||
try {
|
||||
name = map.get("name").toString();
|
||||
|
||||
if (!name.matches("^[A-Za-z0-9()\\[\\]{}_.-]+$")) {
|
||||
throw new InvalidDescriptionException("name '" + name + "' contains invalid characters.");
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
throw new InvalidDescriptionException(ex, "name is not defined");
|
||||
} catch (ClassCastException ex) {
|
||||
|
|
Loading…
Add table
Reference in a new issue