diff options
author | Vitaly Takmazov | 2019-01-22 20:36:11 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-01-22 20:36:11 +0300 |
commit | 7424474bb1c5e72a684544bb17498578e12f084e (patch) | |
tree | d769b75cb38af339fdf6c2bf5be461b9ba04de10 /src/main/java/com/juick/util | |
parent | 41b6764be12c2b21f0de55b8a80091e279577ab5 (diff) |
Fix HTML escaping
Diffstat (limited to 'src/main/java/com/juick/util')
-rw-r--r-- | src/main/java/com/juick/util/MessageUtils.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java index 5669a454..84c29807 100644 --- a/src/main/java/com/juick/util/MessageUtils.java +++ b/src/main/java/com/juick/util/MessageUtils.java @@ -144,6 +144,9 @@ public class MessageUtils { } public static String formatMessage(String msg) { + msg = msg.replaceAll("&", "&"); + msg = msg.replaceAll("<", "<"); + msg = msg.replaceAll(">", ">"); // -- // — msg = msg.replaceAll("((?<=\\s)|(?<=\\A))\\-\\-?((?=\\s)|(?=\\Z))", "$1—$2"); |