Fix for #588 part 4: Pull out escaping of & separately first

This commit is contained in:
str4d
2012-01-17 02:59:21 +00:00
parent 553201db21
commit fc292cd29d

View File

@ -1476,11 +1476,10 @@ public class DataHelper {
public static String escapeHTML(String unescaped) {
if (unescaped == null) return "";
Map<String, String> map = new HashMap<String, String>();
map.put("&","&amp;");
map.put("\"","&quot;");
map.put("<","&lt;");
map.put(">","&gt;");
String escaped = unescaped;
String escaped = unescaped.replaceAll("&","&amp;");
for (Map.Entry<String, String> entry : map.entrySet()) {
String k = entry.getKey();
String v = entry.getValue();