Fix for #588 part 3: Escape & character FIRST so other escapes aren't broken

This commit is contained in:
str4d
2012-01-17 02:17:05 +00:00
parent 452096b976
commit 553201db21

View File

@ -1476,8 +1476,8 @@ public class DataHelper {
public static String escapeHTML(String unescaped) {
if (unescaped == null) return "";
Map<String, String> map = new HashMap<String, String>();
map.put("\"","&quot;");
map.put("&","&amp;");
map.put("\"","&quot;");
map.put("<","&lt;");
map.put(">","&gt;");
String escaped = unescaped;
@ -1497,8 +1497,8 @@ public class DataHelper {
public static String unescapeHTML(String escaped) {
if (escaped == null) return "";
Map<String, String> map = new HashMap<String, String>();
map.put("&quot;","\"");
map.put("&amp;","&");
map.put("&quot;","\"");
map.put("&lt;","<");
map.put("&gt;",">");
String unescaped = escaped;