From 9755338f73f3f87990387602e2920e9ff87fa8a5 Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 17 Jan 2012 22:45:06 +0000 Subject: [PATCH] Fix for #588 part 6: Don't convert nulls to empty strings --- core/java/src/net/i2p/data/DataHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java index f3e4151c2..95809ed46 100644 --- a/core/java/src/net/i2p/data/DataHelper.java +++ b/core/java/src/net/i2p/data/DataHelper.java @@ -1471,10 +1471,10 @@ public class DataHelper { /** * Escape a string for inclusion in HTML * @param unescaped the unescaped string, may be null - * @return the escaped string, or an empty string if null is passed in + * @return the escaped string, or null if null is passed in */ public static String escapeHTML(String unescaped) { - if (unescaped == null) return ""; + if (unescaped == null) return null; Map map = new HashMap(); map.put("\"","""); map.put("<","<"); @@ -1491,10 +1491,10 @@ public class DataHelper { /** * Unescape a string taken from HTML * @param escaped the escaped string, may be null - * @return the unescaped string, or an empty string if null is passed in + * @return the unescaped string, or null if null is passed in */ public static String unescapeHTML(String escaped) { - if (escaped == null) return ""; + if (escaped == null) return null; Map map = new HashMap(); map.put("&","&"); map.put(""","\"");