14 lines
421 B
Java
14 lines
421 B
Java
package eu.siacs.conversations.utils;
|
|
|
|
public class XmlHelper {
|
|
public static String encodeEntities(String content) {
|
|
content = content.replace("&", "&");
|
|
content = content.replace("<", "<");
|
|
content = content.replace(">", ">");
|
|
content = content.replace("\"", """);
|
|
content = content.replace("'", "'");
|
|
content = content.replaceAll("[\\p{Cntrl}&&[^\n\t\r]]", "");
|
|
return content;
|
|
}
|
|
}
|