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.java7
1 files changed, 4 insertions, 3 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 d4867999..82de4782 100644
--- a/juick-www/src/main/java/com/juick/www/NewMessage.java
+++ b/juick-www/src/main/java/com/juick/www/NewMessage.java
@@ -27,6 +27,7 @@ import com.juick.xmpp.extensions.JuickUser;
import com.juick.xmpp.extensions.Nickname;
import com.juick.xmpp.extensions.XOOB;
import net.coobird.thumbnailator.Thumbnails;
+import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.ServletException;
@@ -306,7 +307,7 @@ public class NewMessage {
}
public void doPostComment(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, Stream xmpp, com.juick.User visitor) throws ServletException, IOException {
- int mid = Utils.parseInt(request.getParameter("mid"), 0);
+ int mid = NumberUtils.toInt(request.getParameter("mid"), 0);
if (mid == 0) {
response.sendError(400);
return;
@@ -317,7 +318,7 @@ public class NewMessage {
return;
}
- int rid = Utils.parseInt(request.getParameter("rid"), 0);
+ int rid = NumberUtils.toInt(request.getParameter("rid"), 0);
com.juick.Message reply = null;
if (rid > 0) {
reply = MessagesQueries.getReply(sql, mid, rid);
@@ -419,7 +420,7 @@ public class NewMessage {
}
public void doPostRecomm(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, Stream xmpp, com.juick.User visitor) throws ServletException, IOException {
- int mid = Utils.parseInt(request.getParameter("mid"), 0);
+ int mid = NumberUtils.toInt(request.getParameter("mid"), 0);
if (mid == 0) {
response.sendError(400);
return;