Commit 6e404499 authored by Hiro's avatar Hiro 🏄
Browse files

Sanitize string format before printing

parent 877e9a2e
Pipeline #38997 failed with stage
in 1 minute and 42 seconds
......@@ -180,6 +180,9 @@ public class ResponseBuilder {
}
private void write(PrintWriter pw, String format, Object ... args) {
if (format.indexOf('%') != -1) {
format = format.replace("%", "%%");
}
String stringToWrite = String.format(format, args);
this.charsWritten += stringToWrite.length();
pw.write(stringToWrite);
......@@ -306,4 +309,3 @@ public class ResponseBuilder {
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment