From 5b5bfc99bb7c17df265f9ed2d10b95bbbda864f6 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Thu, 27 Dec 2012 14:05:23 +0700 Subject: bugfix --- src/java/com/juick/http/www/PageTemplates.java | 4 ++-- src/java/com/juick/http/www/RootRedirects.java | 6 +++++- src/java/com/juick/http/www/User.java | 2 +- src/java/com/juick/http/www/UserThread.java | 13 +++++++------ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index 053b020d..4bfbd98d 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -167,7 +167,7 @@ public class PageTemplates { public static void pageFooter(HttpServletRequest request, PrintWriter out, Locale loc, com.juick.User visitor) { ResourceBundle rb = ResourceBundle.getBundle("Global", loc); out.println("
"); - out.println(" "); + out.println(" "); out.print("
juick.com © 2008-2012"); if (sape != null && (visitor == null || visitor.UID == 1)) { String links = sape.getPageLinks(request.getRequestURI(), request.getCookies()).render(); @@ -347,7 +347,7 @@ public class PageTemplates { out.println("
  • "); out.println("
    \""
    "); - out.println(" "); + out.println(" "); out.println(" "); if (msg.Place != null) { out.println(" "); diff --git a/src/java/com/juick/http/www/RootRedirects.java b/src/java/com/juick/http/www/RootRedirects.java index d4e17972..21b0077e 100644 --- a/src/java/com/juick/http/www/RootRedirects.java +++ b/src/java/com/juick/http/www/RootRedirects.java @@ -31,7 +31,11 @@ public class RootRedirects { protected void doGetPostID(Connection sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String strID = request.getRequestURI().substring(1); - int mid = Integer.parseInt(strID); + int mid = 0; + try { + mid = Integer.parseInt(strID); + } catch (NumberFormatException e) { + } if (mid > 0) { com.juick.User author = com.juick.server.MessagesQueries.getMessageAuthor(sql, mid); if (author != null) { diff --git a/src/java/com/juick/http/www/User.java b/src/java/com/juick/http/www/User.java index b60afd0e..5a729a6b 100644 --- a/src/java/com/juick/http/www/User.java +++ b/src/java/com/juick/http/www/User.java @@ -97,7 +97,7 @@ public class User { response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); try { - PageTemplates.pageHead(out, title, null); + PageTemplates.pageHead(out, title, ""); PageTemplates.pageNavigation(out, locale, visitor); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 191b34f1..18ae4d9a 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -64,7 +64,7 @@ public class UserThread { response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); try { - PageTemplates.pageHead(out, title, null); + PageTemplates.pageHead(out, title, ""); PageTemplates.pageNavigation(out, locale, visitor); //PageTemplates.pageUserTitle(out, sql, locale, user, visitor); @@ -117,7 +117,7 @@ public class UserThread { out.println("
      "); out.println("
    • "); out.println("
      \""
      "); - out.println("
      " + PageTemplates.formatJSLocalTime(msg.TimestampString) + "
      "); + out.println("
      " + PageTemplates.formatJSLocalTime(msg.TimestampString) + "\"\"/
      "); out.println(" "); if (msg.Place != null) { out.println(" "); @@ -159,6 +159,7 @@ public class UserThread { } out.print("@" + recomm.get(i) + ""); } + out.println("
  • "); } out.println(" "); @@ -290,13 +291,13 @@ public class UserThread { out.println("\">"); if (msg.AttachmentType != null) { if (msg.AttachmentType.equals("jpg")) { - out.println("
    \"\"/
    "); + out.println("
    \"\"/
    "); } else { out.println("
    \"\"/
    "); } } out.println("
    \""
    "); - out.println(" "); + out.println(" "); out.println(" "); out.println("
    " + PageTemplates.formatMessage(msg.Text) + "
    "); if (msg.VisitorCanComment) { @@ -329,13 +330,13 @@ public class UserThread { out.print("
  • "); if (msg.AttachmentType != null) { if (msg.AttachmentType.equals("jpg")) { - out.println("
    \"\"/
    "); + out.println("
    \"\"/
    "); } else { out.println("
    \"\"/
    "); } } out.println("
    "); - out.println(" "); + out.println(" "); out.println(" "); out.println("
    " + PageTemplates.formatMessage(msg.Text) + "
    "); out.print("
    /" + msg.RID); -- cgit v1.2.3