Skip to content

Commit

Permalink
Excape html string for junit output.
Browse files Browse the repository at this point in the history
  • Loading branch information
wongherlung committed Feb 1, 2018
1 parent e92170b commit 33fff95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion output/junit_xml_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package output

import (
"encoding/xml"
htmlLib "html"
"strconv"

"github.com/GoASTScanner/gas"
Expand Down Expand Up @@ -35,7 +36,7 @@ func generatePlaintext(issue *gas.Issue) string {
return "Results:\n" +
"[" + issue.File + ":" + issue.Line + "] - " +
issue.What + " (Confidence: " + strconv.Itoa(int(issue.Confidence)) +
", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + issue.Code
", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + htmlLib.EscapeString(issue.Code)
}

func groupDataByRules(data *reportInfo) map[string][]*gas.Issue {
Expand Down

0 comments on commit 33fff95

Please sign in to comment.