mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-12-29 12:07:41 +01:00
Handle fields in yaml config files with "/" - fix for #3533
This commit is contained in:
parent
2ef6bf35a5
commit
a40830434d
@ -6,7 +6,7 @@ dependencies {
|
||||
implementation 'org.eclipse.jetty:jetty-server:9.4.26.v20200117'
|
||||
implementation 'org.eclipse.jetty:jetty-servlet:9.4.26.v20200117'
|
||||
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
|
||||
implementation 'org.yaml:snakeyaml:1.23'
|
||||
implementation 'org.yaml:snakeyaml:1.29'
|
||||
implementation 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20180219.1'
|
||||
implementation 'org.postgresql:postgresql:42.2.18'
|
||||
}
|
||||
|
@ -138,9 +138,11 @@ public class ConfigurationNode implements Map<String, Object> {
|
||||
public Object getObject(String path) {
|
||||
if (path.isEmpty())
|
||||
return entries;
|
||||
// Try get first (in case '/' is legit part
|
||||
Object v = get(path);
|
||||
int separator = path.indexOf('/');
|
||||
if (separator < 0)
|
||||
return get(path);
|
||||
if ((v != null) || (separator < 0)) return v;
|
||||
|
||||
String localKey = path.substring(0, separator);
|
||||
Object subvalue = get(localKey);
|
||||
if (subvalue == null)
|
||||
|
@ -455,7 +455,8 @@ class MarkerSetImpl implements MarkerSet {
|
||||
if (markernode != null) {
|
||||
for(String id : markernode.keySet()) {
|
||||
MarkerImpl marker = new MarkerImpl(id, this); /* Make and load marker */
|
||||
if(marker.loadPersistentData(markernode.getNode(id))) {
|
||||
ConfigurationNode cfg = markernode.getNode(id);
|
||||
if ((cfg != null) && marker.loadPersistentData(cfg)) {
|
||||
markers.put(id, marker);
|
||||
}
|
||||
else {
|
||||
@ -468,7 +469,8 @@ class MarkerSetImpl implements MarkerSet {
|
||||
if (areamarkernode != null) {
|
||||
for(String id : areamarkernode.keySet()) {
|
||||
AreaMarkerImpl marker = new AreaMarkerImpl(id, this); /* Make and load marker */
|
||||
if(marker.loadPersistentData(areamarkernode.getNode(id))) {
|
||||
ConfigurationNode cfg = areamarkernode.getNode(id);
|
||||
if ((cfg != null) && marker.loadPersistentData(cfg)) {
|
||||
areamarkers.put(id, marker);
|
||||
if(marker.getBoostFlag()) {
|
||||
if(boostingareamarkers == null) {
|
||||
@ -493,7 +495,8 @@ class MarkerSetImpl implements MarkerSet {
|
||||
if (linemarkernode != null) {
|
||||
for(String id : linemarkernode.keySet()) {
|
||||
PolyLineMarkerImpl marker = new PolyLineMarkerImpl(id, this); /* Make and load marker */
|
||||
if(marker.loadPersistentData(linemarkernode.getNode(id))) {
|
||||
ConfigurationNode cfg = linemarkernode.getNode(id);
|
||||
if ((cfg != null) && marker.loadPersistentData(cfg)) {
|
||||
linemarkers.put(id, marker);
|
||||
}
|
||||
else {
|
||||
@ -506,7 +509,8 @@ class MarkerSetImpl implements MarkerSet {
|
||||
if (circlemarkernode != null) {
|
||||
for(String id : circlemarkernode.keySet()) {
|
||||
CircleMarkerImpl marker = new CircleMarkerImpl(id, this); /* Make and load marker */
|
||||
if(marker.loadPersistentData(circlemarkernode.getNode(id))) {
|
||||
ConfigurationNode cfg = circlemarkernode.getNode(id);
|
||||
if ((cfg != null) && marker.loadPersistentData(cfg)) {
|
||||
circlemarkers.put(id, marker);
|
||||
if(marker.getBoostFlag()) {
|
||||
if(boostingcirclemarkers == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user