Fix issue 1592: Not possible to send < > in chat messages

This commit is contained in:
Sylvain Berfini 2014-11-04 11:09:34 +01:00
parent d6890b4a27
commit b8b45c024b

View file

@ -272,6 +272,12 @@ public class BubbleChat {
}
public static Spanned getTextWithHttpLinks(String text) {
if (text.contains("<")) {
text = text.replace("<", "&lt;");
}
if (text.contains(">")) {
text = text.replace(">", "&gt;");
}
if (text.contains("http://")) {
int indexHttp = text.indexOf("http://");
int indexFinHttp = text.indexOf(" ", indexHttp) == -1 ? text.length() : text.indexOf(" ", indexHttp);