Fully restrict the org.bukkit and net.minecraft namespace

This commit is contained in:
Wesley Wolfe 2012-08-19 05:53:30 -05:00 committed by EvilSeph
parent 6bbeb93103
commit 4c766c92ac

View File

@ -30,6 +30,9 @@ public class PluginClassLoader extends URLClassLoader {
} }
protected Class<?> findClass(String name, boolean checkGlobal) throws ClassNotFoundException { protected Class<?> findClass(String name, boolean checkGlobal) throws ClassNotFoundException {
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
throw new ClassNotFoundException(name);
}
Class<?> result = classes.get(name); Class<?> result = classes.get(name);
if (result == null) { if (result == null) {