diff options
author | Vitaly Takmazov | 2016-12-20 14:28:00 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-20 14:28:00 +0300 |
commit | 3859c9616d0a7a04e68427d173b863161b818140 (patch) | |
tree | cba4d1aea88b7ce0d94cbc30fc05f765c9faaa15 /juick-core/src/main/java/com/juick/util | |
parent | 8b02f969d3a09e39557474eb90ec821d550e3b1b (diff) |
StringUtils.EMPTY
Diffstat (limited to 'juick-core/src/main/java/com/juick/util')
-rw-r--r-- | juick-core/src/main/java/com/juick/util/MessageUtils.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/juick-core/src/main/java/com/juick/util/MessageUtils.java b/juick-core/src/main/java/com/juick/util/MessageUtils.java index 96d650a8..0027716b 100644 --- a/juick-core/src/main/java/com/juick/util/MessageUtils.java +++ b/juick-core/src/main/java/com/juick/util/MessageUtils.java @@ -1,5 +1,7 @@ package com.juick.util; +import org.apache.commons.lang3.StringUtils; + import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -41,7 +43,7 @@ public class MessageUtils { Matcher m = regexLinks2.matcher(msg); StringBuffer sb = new StringBuffer(); while (m.find()) { - String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", ""); + String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", StringUtils.EMPTY); m.appendReplacement(sb, "$1$2<a href=\"" + url + "\" rel=\"nofollow\">" + url + "</a>$5"); } m.appendTail(sb); @@ -105,7 +107,7 @@ public class MessageUtils { Matcher m = regexLinks2.matcher(msg); StringBuffer sb = new StringBuffer(); while (m.find()) { - String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", ""); + String url = m.group(3).replace(" ", "%20").replaceAll("\\s+", StringUtils.EMPTY); m.appendReplacement(sb, "$1$2<a href=\"" + url + "\" rel=\"nofollow\">$4</a>$5"); } m.appendTail(sb); |