diff options
author | 2013-09-06 15:02:30 +0700 | |
---|---|---|
committer | 2013-09-06 15:02:30 +0700 | |
commit | 02fa30624211b46c8f2adcd0c459ffeb1c35a743 (patch) | |
tree | 68fc8e0678395ae3cad98d5e4bcab7d9ea417961 /src/java/com/juick/http | |
parent | e1d907ac56fcfe5c380ef781530488c799a1f477 (diff) |
Bugfixes: PNG, tags, htmlencode
Diffstat (limited to 'src/java/com/juick/http')
-rw-r--r-- | src/java/com/juick/http/www/Blogs.java | 4 | ||||
-rw-r--r-- | src/java/com/juick/http/www/User.java | 2 | ||||
-rw-r--r-- | src/java/com/juick/http/www/Utils.java | 13 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/java/com/juick/http/www/Blogs.java b/src/java/com/juick/http/www/Blogs.java index 8e459dc1..0f13d946 100644 --- a/src/java/com/juick/http/www/Blogs.java +++ b/src/java/com/juick/http/www/Blogs.java @@ -213,7 +213,7 @@ public class Blogs { out.println(" <li><a href=\"/?show=photos\">" + rb.getString("With photos") + "</a></li>"); out.println(" </ul>"); out.println(" <hr/>"); - out.println(" <p>" + getTags(sql, 40) + "</p>"); + out.println(" <p>" + getTags(sql, 45) + "</p>"); out.println("</div>"); out.println("</div>"); // topwrapper @@ -233,7 +233,7 @@ public class Blogs { PreparedStatement stmt = null; ResultSet rs = null; try { - stmt = sql.prepareStatement("SELECT tags.name AS name,COUNT(DISTINCT messages.user_id) AS cnt FROM (messages INNER JOIN messages_tags ON (messages.ts>TIMESTAMPADD(DAY,-3,NOW()) AND messages.message_id=messages_tags.message_id)) INNER JOIN tags ON messages_tags.tag_id=tags.tag_id WHERE tags.tag_id NOT IN (SELECT tag_id FROM tags_ignore) GROUP BY tags.tag_id ORDER BY cnt DESC LIMIT ?"); + stmt = sql.prepareStatement("SELECT tags.name AS name,COUNT(DISTINCT messages.user_id) AS cnt FROM (messages INNER JOIN messages_tags ON (messages.ts>TIMESTAMPADD(MONTH,-1,NOW()) AND messages.message_id=messages_tags.message_id)) INNER JOIN tags ON messages_tags.tag_id=tags.tag_id WHERE tags.tag_id NOT IN (SELECT tag_id FROM tags_ignore) GROUP BY tags.tag_id ORDER BY cnt DESC LIMIT ?"); stmt.setInt(1, cnt); rs = stmt.executeQuery(); rs.beforeFirst(); diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java index 83226089..3b526727 100644 --- a/src/java/com/juick/http/www/User.java +++ b/src/java/com/juick/http/www/User.java @@ -304,7 +304,7 @@ public class User { } else { out.println(" <li><a href=\"/post?body=BL+%40" + user.UName + "\" title=\"" + rb.getString("(UToolbar) Block") + "\"><div style=\"background-position: -80px 0\"></div></a></li>"); } - if (!UserQueries.isInBL(sql, user.UID, visitor.UID)) { + if (!UserQueries.isInBL(sql, user.UID, visitor.UID) && !UserQueries.isInBL(sql, visitor.UID, user.UID)) { out.println(" <li><a href=\"/post?body=PM+%40" + user.UName + "\" title=\"" + rb.getString("(UToolbar) Private") + "\"><div style=\"background-position: -112px 0\"></div></a></li>"); } out.println(" </ul>"); diff --git a/src/java/com/juick/http/www/Utils.java b/src/java/com/juick/http/www/Utils.java index 4c41555e..b2d9a999 100644 --- a/src/java/com/juick/http/www/Utils.java +++ b/src/java/com/juick/http/www/Utils.java @@ -107,20 +107,11 @@ public class Utils { } public static String encodeHTML(String str) { - String ret = str; - ret = ret.replaceAll("&", "&"); - ret = ret.replaceAll("<", "<"); - ret = ret.replaceAll(">", ">"); - ret = ret.replaceAll("'", "'"); - ret = ret.replaceAll("\"", """); - ret = ret.replaceAll("\n", " "); - return str; + return str.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("'", "'").replaceAll("\"", """).replaceAll("\n", " "); } public static String encodeSphinx(String str) { - String ret = str; - ret = ret.replaceAll("@", "\\\\@"); - return ret; + return str.replaceAll("@", "\\\\@"); } public static String fetchURL(String url) { |