diff options
Diffstat (limited to 'src/java/com/juick/http/www/User.java')
-rw-r--r-- | src/java/com/juick/http/www/User.java | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java index 71b9ae16..1e469a1d 100644 --- a/src/java/com/juick/http/www/User.java +++ b/src/java/com/juick/http/www/User.java @@ -49,8 +49,14 @@ public class User { com.juick.Tag paramTag = null; String paramTagStr = request.getParameter("tag"); - if (paramTagStr != null && paramTagStr.length() < 64) { - paramTag = TagQueries.getTag(sql, paramTagStr, false); + if (paramTagStr != null) { + if (paramTagStr.length() < 64) { + paramTag = TagQueries.getTag(sql, paramTagStr, false); + } + if (paramTag == null) { + response.sendError(404); + return; + } } int paramBefore = 0; @@ -107,28 +113,26 @@ public class User { pageUserColumn(out, sql, user, visitor); - out.println("<section id=\"content\">"); - out.println("<ul>"); if (mids.size() > 0) { + out.println("<section id=\"content\">"); PageTemplates.printMessages(out, sql, user, mids, visitor, visitor == null ? 4 : 5, 0); - } - out.println("</ul>"); - if (mids.size() >= 20) { - String nextpage = "?before=" + mids.get(mids.size() - 1); - if (paramShow != null) { - nextpage += "&show=" + paramShow; - } - if (paramTag != null) { - nextpage += "&tag=" + URLEncoder.encode(paramTag.Name, "UTF-8"); - } - if (paramSearch != null) { - nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); + if (mids.size() >= 20) { + String nextpage = "?before=" + mids.get(mids.size() - 1); + if (paramShow != null) { + nextpage += "&show=" + paramShow; + } + if (paramTag != null) { + nextpage += "&tag=" + URLEncoder.encode(paramTag.Name, "UTF-8"); + } + if (paramSearch != null) { + nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); + } + out.println("<p class=\"page\"><a href=\"" + nextpage + "\">Older →</a></p>"); } - out.println("<p class=\"page\"><a href=\"" + nextpage + "\">Older →</a></p>"); - } - out.println("</section>"); + out.println("</section>"); + } PageTemplates.pageFooter(request, out, visitor, true); PageTemplates.pageDialogTemplate(out); |