mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
add html escaping/unescaping utls
This commit is contained in:
parent
6bf3f78b89
commit
f179bb68fd
@ -22,6 +22,7 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.logging.Level;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
@ -63,4 +64,22 @@ public class EscapeUtil {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape html
|
||||
* @param toEscape text (with html tags) to escape
|
||||
* @return html-escaped string
|
||||
*/
|
||||
public static String escapeHtml(String toEscape) {
|
||||
return StringEscapeUtils.escapeHtml(toEscape);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unescape html
|
||||
* @param toUnescape text (potentially escaped html) to unescape
|
||||
* @return html unescaped string
|
||||
*/
|
||||
public static String unEscapeHtml(String toUnescape) {
|
||||
return StringEscapeUtils.unescapeHtml(toUnescape);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user