From 434f054e382e8265b4746edc7a58e0c2e144cde7 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 3 Apr 2011 16:26:27 +0200 Subject: [PATCH] A plugin's name can now only contain: [A-Za-z0-9()\[\]{}_.-] By: Erik Broes --- .../main/java/org/bukkit/plugin/PluginDescriptionFile.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java index cc6d893cee..4acc712992 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java +++ b/paper-api/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java @@ -132,6 +132,10 @@ public final class PluginDescriptionFile { private void loadMap(Map 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) {