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.java11
1 files changed, 6 insertions, 5 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 60ac08de..de6d8038 100644
--- a/juick-www/src/main/java/com/juick/www/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/NewMessage.java
@@ -21,6 +21,7 @@ import com.juick.Tag;
import com.juick.server.*;
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.math.NumberUtils;
import org.slf4j.Logger;
@@ -127,7 +128,7 @@ public class NewMessage {
String taglink = "";
try {
taglink = "<a onclick=\"return addTag('" + StringEscapeUtils.escapeHtml4(tags.get(i).getTag().getName()) + "')\" href=\"/" +
- visitor.getName() + "/?tag=" + URLEncoder.encode(tags.get(i).getTag().getName(), "utf-8") +
+ visitor.getName() + "/?tag=" + URLEncoder.encode(tags.get(i).getTag().getName(), CharEncoding.UTF_8) +
"\" title=\"" + tags.get(i).getUsageCount() + "\">" + StringEscapeUtils.escapeHtml4(tags.get(i).getTag().getName()) + "</a>";
} catch (UnsupportedEncodingException e) {
}
@@ -240,21 +241,21 @@ public class NewMessage {
tagscomma += jmsg.getTags().get(i);
}
- String url = URLEncoder.encode("http://juick.com/" + mid, "utf-8");
+ String url = URLEncoder.encode("http://juick.com/" + mid, CharEncoding.UTF_8);
String sharetwi = hashtags + " " + body;
if (sharetwi.length() > 115) {
sharetwi = sharetwi.substring(0, 114) + "…";
}
sharetwi += " http://juick.com/" + mid;
- String sharelj = URLEncoder.encode(body + "\n", "utf-8") + url;
+ String sharelj = URLEncoder.encode(body + "\n", CharEncoding.UTF_8) + url;
out.println("<section id=\"content\">");
out.println("<h1>Сообщение опубликовано</h1>");
out.println("<p>Поделитесь своим новым постом в социальных сетях:</p>");
if (CrosspostQueries.getTwitterTokens(sql, visitor.getUid()).isPresent()) {
- out.println("<p class=\"social\"><a href=\"https://twitter.com/intent/tweet?text=" + URLEncoder.encode(sharetwi, "utf-8") + "\" class=\"ico32-twi sharenew\">Отправить в Twitter</a></p>");
+ out.println("<p class=\"social\"><a href=\"https://twitter.com/intent/tweet?text=" + URLEncoder.encode(sharetwi, CharEncoding.UTF_8) + "\" class=\"ico32-twi sharenew\">Отправить в Twitter</a></p>");
}
- out.println("<p class=\"social\"><a href=\"http://www.livejournal.com/update.bml?subject=" + URLEncoder.encode(hashtags, "utf-8") + "&event=" + sharelj + "&prop_taglist=" + URLEncoder.encode(tagscomma, "utf-8") + "\" target=\"_blank\" class=\"ico32-lj sharenew\">Отправить в LiveJournal</a></p>");
+ out.println("<p class=\"social\"><a href=\"http://www.livejournal.com/update.bml?subject=" + URLEncoder.encode(hashtags, CharEncoding.UTF_8) + "&event=" + sharelj + "&prop_taglist=" + URLEncoder.encode(tagscomma, CharEncoding.UTF_8) + "\" target=\"_blank\" class=\"ico32-lj sharenew\">Отправить в LiveJournal</a></p>");
out.println("<p class=\"social\"><a href=\"https://vk.com/share.php?url=" + url + "\" class=\"ico32-vk sharenew\">Отправить в ВКонтакте</a></p>");
if (CrosspostQueries.getFacebookToken(sql, visitor.getUid()).isPresent()) {
out.println("<p class=\"social\"><a href=\"https://www.facebook.com/sharer/sharer.php?u=" + url + "\" class=\"ico32-fb sharenew\">Отправить в Facebook</a></p>");