aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/Main.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/Main.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/juick-api/src/main/java/com/juick/api/Main.java b/juick-api/src/main/java/com/juick/api/Main.java
index 47c4e448..cad991ef 100644
--- a/juick-api/src/main/java/com/juick/api/Main.java
+++ b/juick-api/src/main/java/com/juick/api/Main.java
@@ -32,6 +32,7 @@ import com.juick.xmpp.extensions.Nickname;
import com.juick.xmpp.extensions.XOOB;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.dbcp2.BasicDataSource;
+import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.ServletException;
@@ -223,7 +224,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
}
switch (uri) {
case "/post":
- int mid = Utils.parseInt(request.getParameter("mid"), 0);
+ int mid = NumberUtils.toInt(request.getParameter("mid"), 0);
if (mid == 0) {
doPostMessage(jdbc, request, response, xmpp, vuid);
} else {
@@ -356,7 +357,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
public void doPostComment(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response, Stream xmpp, int vuid)
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;
@@ -367,7 +368,7 @@ public class Main extends HttpServlet implements Stream.StreamListener {
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);