anotherim/src/main/java/eu/siacs/conversations/utils/XmlHelper.java

14 lines
416 B
Java
Raw Normal View History

2014-10-22 16:38:44 +00:00
package eu.siacs.conversations.utils;
public class XmlHelper {
public static String encodeEntities(String content) {
content = content.replace("&", "&");
content = content.replace("<", "&lt;");
content = content.replace(">", "&gt;");
content = content.replace("\"", "&quot;");
content = content.replace("'", "&apos;");
2016-06-01 07:04:08 +00:00
content = content.replaceAll("\\p{Cc}&&[^\n\r\t]", "");
2014-10-22 16:38:44 +00:00
return content;
}
}