commit 351212da2439503b1d792a44966325410da4d8f6 Author: iwakeh iwakeh@torproject.org Date: Sat Sep 16 15:13:29 2017 +0000
Use modern commons lib lang3 instead of legacy version (lang-2). --- build.xml | 2 +- src/main/java/org/torproject/exonerator/ExoneraTorServlet.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/build.xml b/build.xml index a63f4eb..66d78eb 100644 --- a/build.xml +++ b/build.xml @@ -20,7 +20,7 @@ <include name="metrics-lib-${metricslibversion}.jar"/> <include name="commons-compress-1.13.jar"/> <include name="commons-codec-1.10.jar"/> - <include name="commons-lang-2.6.jar"/> + <include name="commons-lang3-3.5.jar"/> <include name="gson-2.4.jar" /> <include name="postgresql-9.4.1212.jar"/> <include name="servlet-api-3.0.jar"/> diff --git a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java index 1e1bc42..cba4420 100644 --- a/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java +++ b/src/main/java/org/torproject/exonerator/ExoneraTorServlet.java @@ -3,7 +3,7 @@
package org.torproject.exonerator;
-import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils;
import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -424,8 +424,8 @@ public class ExoneraTorServlet extends HttpServlet { private void writeSummaryInvalidIp(PrintWriter out, ResourceBundle rb, String ipParameter) throws IOException { String escapedIpParameter = ipParameter.length() > 40 - ? StringEscapeUtils.escapeHtml(ipParameter.substring(0, 40)) - + "[...]" : StringEscapeUtils.escapeHtml(ipParameter); + ? StringEscapeUtils.escapeHtml4(ipParameter.substring(0, 40)) + + "[...]" : StringEscapeUtils.escapeHtml4(ipParameter); this.writeSummary(out, rb.getString("summary.heading"), "panel-danger", rb.getString("summary.invalidparams.invalidip.title"), null, @@ -436,9 +436,9 @@ public class ExoneraTorServlet extends HttpServlet { private void writeSummaryInvalidTimestamp(PrintWriter out, ResourceBundle rb, String timestampParameter) throws IOException { String escapedTimestampParameter = timestampParameter.length() > 20 - ? StringEscapeUtils.escapeHtml(timestampParameter + ? StringEscapeUtils.escapeHtml4(timestampParameter .substring(0, 20)) + "[...]" - : StringEscapeUtils.escapeHtml(timestampParameter); + : StringEscapeUtils.escapeHtml4(timestampParameter); this.writeSummary(out, rb.getString("summary.heading"), "panel-danger", rb.getString("summary.invalidparams.invalidtimestamp.title"),