Skip to content

Commit 8b87505

Browse files
authored
Merge pull request #163 from wongherlung/fix-junit-failure-text
Escape html string for JUnit output
2 parents e92170b + 33fff95 commit 8b87505

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

output/junit_xml_format.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package output
22

33
import (
44
"encoding/xml"
5+
htmlLib "html"
56
"strconv"
67

78
"github.com/GoASTScanner/gas"
@@ -35,7 +36,7 @@ func generatePlaintext(issue *gas.Issue) string {
3536
return "Results:\n" +
3637
"[" + issue.File + ":" + issue.Line + "] - " +
3738
issue.What + " (Confidence: " + strconv.Itoa(int(issue.Confidence)) +
38-
", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + issue.Code
39+
", Severity: " + strconv.Itoa(int(issue.Severity)) + ")\n" + "> " + htmlLib.EscapeString(issue.Code)
3940
}
4041

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

0 commit comments

Comments
 (0)