diff options
author | 2016-12-16 15:41:14 +0300 | |
---|---|---|
committer | 2016-12-16 15:41:14 +0300 | |
commit | 300a0439b2a6e26d9025247ef780c886616d4ae1 (patch) | |
tree | bcdb7613c2c5f37b870cbe18241894dba9428fae /juick-www/src/main/java/com/juick/www/User.java | |
parent | 18a8595d2150edc92084c94b9dbb8f4309d3ed36 (diff) |
CharEncoding.UTF_8
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/User.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/User.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/juick-www/src/main/java/com/juick/www/User.java b/juick-www/src/main/java/com/juick/www/User.java index 088fb004..8a937565 100644 --- a/juick-www/src/main/java/com/juick/www/User.java +++ b/juick-www/src/main/java/com/juick/www/User.java @@ -21,6 +21,7 @@ import com.juick.server.MessagesQueries; import com.juick.server.TagQueries; import com.juick.server.UserQueries; import com.juick.server.helpers.TagStats; +import org.apache.commons.lang3.CharEncoding; import org.apache.commons.lang3.StringEscapeUtils; import org.springframework.jdbc.core.JdbcTemplate; @@ -59,7 +60,7 @@ public class User { Errors.doGet404(sql, request, response); return; } else if (!paramTag.getName().equals(paramTagStr)) { - String url = "/" + user.getName() + "/?tag=" + URLEncoder.encode(paramTag.getName(), "UTF-8"); + String url = "/" + user.getName() + "/?tag=" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8); Utils.sendPermanentRedirect(response, url); return; } @@ -133,7 +134,7 @@ public class User { if (paramTag != null) { out.println("<p class=\"page\"><a href=\"/tag/" + - URLEncoder.encode(paramTag.getName(), "UTF-8") + "\">← Все записи с тегом <b>" + + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8) + "\">← Все записи с тегом <b>" + StringEscapeUtils.escapeHtml4(paramTag.getName()) + "</b></a></p>"); } @@ -145,10 +146,10 @@ public class User { nextpage += "&show=" + paramShow; } if (paramTag != null) { - nextpage += "&tag=" + URLEncoder.encode(paramTag.getName(), "UTF-8"); + nextpage += "&tag=" + URLEncoder.encode(paramTag.getName(), CharEncoding.UTF_8); } if (paramSearch != null) { - nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); + nextpage += "&search=" + URLEncoder.encode(paramSearch, CharEncoding.UTF_8); } out.println("<p class=\"page\"><a href=\"" + nextpage + "\" rel=\"prev\">Читать дальше →</a></p>"); } @@ -332,7 +333,7 @@ public class User { for (int i = 0; i < count; i++) { String tag = StringEscapeUtils.escapeHtml4(tags.get(i).getTag().getName()); try { - tag = "<a href=\"./?tag=" + URLEncoder.encode(tags.get(i).getTag().getName(), "UTF-8") + "\" title=\"" + tag = "<a href=\"./?tag=" + URLEncoder.encode(tags.get(i).getTag().getName(), CharEncoding.UTF_8) + "\" title=\"" + tags.get(i).getUsageCount() + "\" rel=\"nofollow\">" + tag + "</a>"; } catch (UnsupportedEncodingException e) { } |