conversations-classic/src/main/java/eu/siacs/conversations/utils/XmlHelper.java
2016-06-19 00:07:15 +02:00

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("<", "&lt;");
content = content.replace(">", "&gt;");
content = content.replace("\"", "&quot;");
content = content.replace("'", "&apos;");
content = content.replaceAll("[\\p{Cntrl}&&[^\n\t\r]]", "");
return content;
}
}