[Bleeding] Blacklist certain plugin names

By: t00thpick1 <t00thpick1dirko@gmail.com>
This commit is contained in:
Bukkit/Spigot
2014-02-07 20:30:34 -05:00
parent 4d3aba0a11
commit e833c88a72
2 changed files with 8 additions and 2 deletions

View File

@@ -207,7 +207,7 @@ public final class PluginDescriptionFile {
* @param mainClass Full location of the main class of this plugin
*/
public PluginDescriptionFile(final String pluginName, final String pluginVersion, final String mainClass) {
name = pluginName;
name = pluginName.replace(' ', '_');
version = pluginVersion;
main = mainClass;
}
@@ -801,6 +801,7 @@ public final class PluginDescriptionFile {
if (!name.matches("^[A-Za-z0-9 _.-]+$")) {
throw new InvalidDescriptionException("name '" + name + "' contains invalid characters.");
}
name = name.replace(' ', '_');
} catch (NullPointerException ex) {
throw new InvalidDescriptionException(ex, "name is not defined");
} catch (ClassCastException ex) {