Skip to content
Permalink
Browse files

Hot fix for judge ratings export as CSV broke when proposal titles an…

…d pitches had quotes.
  • Loading branch information...
carlosbpf committed Aug 28, 2019
1 parent b83e9e6 commit 3c7982639370c01eea8453e16b3741cf92d275a1
@@ -42,6 +42,7 @@ public ProposalReviewCsvExporter(Contest contest,
this.ratingTypes = ratingTypes;
}


public String getCsvString() {
if (proposalToProposalReviewsMap.isEmpty()) {
return "";
@@ -54,11 +55,13 @@ public String getCsvString() {
String proposalName = ProposalAttributeClientUtil.getProposalAttribute(proposal.getId(),
ProposalAttributeKeys.NAME, 0L).getStringValue();



for (ProposalReview proposalReview : proposalReviews) {
for (Member reviewer : proposalReview.getReviewers()) {

tableBody.append(getRowHeader(proposalName, proposalReview));
tableBody.append(String.format("\"%s %s\"", reviewer.getFirstName(), reviewer.getLastName()));
tableBody.append(String.format("\"%s %s\"", (reviewer.getFirstName()), (reviewer.getLastName())));

StringBuilder commentString = new StringBuilder();

@@ -206,7 +209,7 @@ private String replaceNonAsciiCharacters(String str) {

private String escapeQuote(String input) {
//replace double quotes with single quotes (safer than 3 quotes)
input = StringUtils.replace(input, "\"", "'");
input = StringUtils.replace(input, "\\\"", "'");
//delete new lines
input = StringUtils.replace(input, "\r\n", " ");
input = StringUtils.replace(input, "\n", " ");

0 comments on commit 3c79826

Please sign in to comment.
You can’t perform that action at this time.