Commits

blablubbabc authored and md_5 committed 967a73012c4
SPIGOT-7906: Increase YAML nesting limit to 100
No tags

src/main/java/org/bukkit/configuration/file/YamlConfiguration.java

Modified
54 54 private final YamlConstructor constructor;
55 55 private final YamlRepresenter representer;
56 56 private final Yaml yaml;
57 57
58 58 public YamlConfiguration() {
59 59 yamlDumperOptions = new DumperOptions();
60 60 yamlDumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
61 61 yamlLoaderOptions = new LoaderOptions();
62 62 yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26
63 63 yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); // SPIGOT-7161: Not ideal, but was default pre SnakeYAML 1.32
64 + yamlLoaderOptions.setNestingDepthLimit(100); // SPIGOT-7906: The default limit (50) can be easily reached with nested bundles
64 65
65 66 constructor = new YamlConstructor(yamlLoaderOptions);
66 67 representer = new YamlRepresenter(yamlDumperOptions);
67 68 representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
68 69
69 70 yaml = new Yaml(constructor, representer, yamlDumperOptions, yamlLoaderOptions);
70 71 }
71 72
72 73 @NotNull
73 74 @Override

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut