Skip to content

Commit

Permalink
Merge pull request #185 from internetarchive/trough-esc-sql
Browse files Browse the repository at this point in the history
escape strings in sql posted to trough
  • Loading branch information
jkafader committed Sep 21, 2017
2 parents 4c438d3 + 7fc1c2f commit 65004ea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import org.apache.commons.collections.Closure;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
Expand Down Expand Up @@ -178,7 +179,7 @@ protected String sqlValue(Object o) {
} else if (o instanceof Number) {
return o.toString();
} else {
return "'" + o + "'";
return "'" + StringEscapeUtils.escapeSql(o.toString()) + "'";
}
}

Expand Down

0 comments on commit 65004ea

Please sign in to comment.