Validate plugin dependency IDs in accordance to plugin ID requirements (#1231)
This commit is contained in:
@@ -72,6 +72,14 @@ public class JavaPluginLoader implements PluginLoader {
|
||||
throw new InvalidPluginException("Plugin ID '" + pd.getId() + "' is invalid.");
|
||||
}
|
||||
|
||||
for (SerializedPluginDescription.Dependency dependency : pd.getDependencies()) {
|
||||
if (!SerializedPluginDescription.ID_PATTERN.matcher(dependency.getId()).matches()) {
|
||||
throw new InvalidPluginException(
|
||||
"Dependency ID '" + dependency.getId() + "' for plugin '" + pd.getId() + "' is invalid."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return createCandidateDescription(pd, source);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user