Skip to content

Commit

Permalink
Use existing escape code
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Nov 19, 2019
1 parent 0b07147 commit 23703f1
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,11 @@ public String toString() {
}

if (user != null) {
String escapedUser = user.replace("\"", "\"\"");
if (escapedUser.contains(",")) {
escapedUser = "\"" + escapedUser + "\"";
if (user.contains(",") || user.contains("\n")) {
string += String.format(",%s", getEscapedValueForCsv(user));
} else {
string += String.format(",%s", user);
}

string += String.format(",%s", escapedUser);
}

return string;
Expand Down

0 comments on commit 23703f1

Please sign in to comment.