Changeset 9755338


Ignore:
Timestamp:
Jan 17, 2012 10:45:06 PM (9 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
9532980, e183966
Parents:
dafd722
Message:

Fix for #588 part 6: Don't convert nulls to empty strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/DataHelper.java

    rdafd722 r9755338  
    14721472     * Escape a string for inclusion in HTML
    14731473     * @param unescaped the unescaped string, may be null
    1474      * @return the escaped string, or an empty string if null is passed in
     1474     * @return the escaped string, or null if null is passed in
    14751475     */
    14761476    public static String escapeHTML(String unescaped) {
    1477         if (unescaped == null) return "";
     1477        if (unescaped == null) return null;
    14781478        Map<String, String> map = new HashMap<String, String>();
    14791479        map.put("\"","&quot;");
     
    14921492     * Unescape a string taken from HTML
    14931493     * @param escaped the escaped string, may be null
    1494      * @return the unescaped string, or an empty string if null is passed in
     1494     * @return the unescaped string, or null if null is passed in
    14951495     */
    14961496    public static String unescapeHTML(String escaped) {
    1497         if (escaped == null) return "";
     1497        if (escaped == null) return null;
    14981498        Map<String, String> map = new HashMap<String, String>();
    14991499        map.put("&amp;","&");
Note: See TracChangeset for help on using the changeset viewer.