A plugin's name can now only contain: [A-Za-z0-9()\[\]{}_.-]

This commit is contained in:
Erik Broes 2011-04-03 16:26:27 +02:00
parent 5fd890208f
commit d2d7ea50eb

View File

@ -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) {