aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/NewMessage.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/NewMessage.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/NewMessage.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/juick-www/src/main/java/com/juick/www/NewMessage.java b/juick-www/src/main/java/com/juick/www/NewMessage.java
index de6d8038..43ea039c 100644
--- a/juick-www/src/main/java/com/juick/www/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/NewMessage.java
@@ -23,6 +23,7 @@ import com.juick.server.helpers.TagStats;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -79,7 +80,7 @@ public class NewMessage {
String body = request.getParameter("body");
if (body == null) {
- body = "";
+ body = StringUtils.EMPTY;
} else {
if (body.length() > 4096) {
body = body.substring(0, 4096);
@@ -125,7 +126,7 @@ public class NewMessage {
if (i > 0) {
out.print(" ");
}
- String taglink = "";
+ String taglink = StringUtils.EMPTY;
try {
taglink = "<a onclick=\"return addTag('" + StringEscapeUtils.escapeHtml4(tags.get(i).getTag().getName()) + "')\" href=\"/" +
visitor.getName() + "/?tag=" + URLEncoder.encode(tags.get(i).getTag().getName(), CharEncoding.UTF_8) +
@@ -154,7 +155,7 @@ public class NewMessage {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
- body = body.replace("\r", "");
+ body = body.replace("\r", StringUtils.EMPTY);
List<Tag> tags = Utils.parseTags(sql, request.getParameter("tags"));
@@ -230,8 +231,8 @@ public class NewMessage {
PageTemplates.pageHead(out, visitor, "Сообщение опубликовано", null);
PageTemplates.pageNavigation(out, visitor, null);
- String hashtags = "";
- String tagscomma = "";
+ String hashtags = StringUtils.EMPTY;
+ String tagscomma = StringUtils.EMPTY;
for (int i = 0; i < jmsg.getTags().size(); i++) {
if (i > 0) {
hashtags += " ";
@@ -298,7 +299,7 @@ public class NewMessage {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
- body = body.replace("\r", "");
+ body = body.replace("\r", StringUtils.EMPTY);
if ((msg.ReadOnly && msg.getUser().getUid() != visitor.getUid()) || UserQueries.isInBLAny(sql, msg.getUser().getUid(), visitor.getUid()) || (reply != null && UserQueries.isInBLAny(sql, reply.getUser().getUid(), visitor.getUid()))) {
response.sendError(HttpServletResponse.SC_FORBIDDEN);