Skip to content

Commit 1c174a7

Browse files
committed
Fixes
1 parent 6180418 commit 1c174a7

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/com/

src/com/empcraft/plot2dynmap/Main.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import java.util.Collections;
66
import java.util.Comparator;
77
import java.util.HashMap;
8-
import java.util.Iterator;
98
import java.util.List;
109
import java.util.Map;
1110
import java.util.Set;
1211
import java.util.UUID;
13-
import java.util.concurrent.atomic.AtomicInteger;
1412

13+
import org.apache.commons.lang.StringEscapeUtils;
1514
import org.apache.commons.lang.StringUtils;
1615
import org.bukkit.World;
1716
import org.bukkit.configuration.ConfigurationSection;
@@ -110,11 +109,11 @@ public void run() {
110109
private String formatInfoWindow(final PlotWrapper plot) {
111110
String v = "<div class=\"plotinfo\">" + this.infowindow + "</div>";
112111
v = v.replace("%id%", plot.id.x + "," + plot.id.y);
113-
v = v.replace("%alias%", this.infoelement.replace("%values%", plot.alias).replace("%key%", "Alias"));
112+
v = v.replace("%alias%", this.infoelement.replace("%values%", StringEscapeUtils.escapeHtml(plot.alias)).replace("%key%", "Alias"));
114113
v = v.replace("%owner%", this.infoelement.replace("%values%", plot.owner).replace("%key%", "Owner"));
115114
v = v.replace("%members%", this.infoelement.replace("%values%", plot.helpers).replace("%key%", "Members"));
116115
v = v.replace("%trusted%", this.infoelement.replace("%values%", plot.trusted).replace("%key%", "Trusted"));
117-
v = v.replace("%flags%", this.infoelement.replace("%values%", plot.flags).replace("%key%", "Flags"));
116+
v = v.replace("%flags%", this.infoelement.replace("%values%", StringEscapeUtils.escapeHtml(plot.flags)).replace("%key%", "Flags"));
118117
v = v.replace("%owner%", plot.owner);
119118
return v;
120119
}
@@ -174,7 +173,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
174173
double[] z = null;
175174

176175
final String id = name;
177-
176+
int i = 0;
178177
for (RegionWrapper region : MainUtil.getRegions(MainUtil.getPlot(world.getName(), plot.id))) {
179178

180179
x = new double[4];
@@ -188,7 +187,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
188187
x[3] = region.maxX;
189188
z[3] = region.minZ;
190189

191-
final String markerid = world.getName() + "_" + id;
190+
final String markerid = world.getName() + "_" + id + (i == 0 ? "" : "-" + i);
192191
AreaMarker m = this.resareas.remove(markerid); /* Existing area? */
193192
if (m == null) {
194193
m = set.createAreaMarker(markerid, name, false, world.getName(), x, z, false);
@@ -207,6 +206,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
207206
m.setDescription(desc); /* Set popup */
208207

209208
newmap.put(markerid, m);
209+
i++;
210210
}
211211
}
212212

0 commit comments

Comments
 (0)