mirror of
https://github.com/securego/gosec.git
synced 2024-12-26 04:25:52 +00:00
Merge pull request #163 from wongherlung/fix-junit-failure-text
Escape html string for JUnit output
This commit is contained in:
commit
8b87505d97
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@ package output
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/xml"
|
"encoding/xml"
|
||||||
|
htmlLib "html"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/GoASTScanner/gas"
|
"github.com/GoASTScanner/gas"
|
||||||
|
@ -35,7 +36,7 @@ func generatePlaintext(issue *gas.Issue) string {
|
||||||
return "Results:\n" +
|
return "Results:\n" +
|
||||||
"[" + issue.File + ":" + issue.Line + "] - " +
|
"[" + issue.File + ":" + issue.Line + "] - " +
|
||||||
issue.What + " (Confidence: " + strconv.Itoa(int(issue.Confidence)) +
|
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 {
|
func groupDataByRules(data *reportInfo) map[string][]*gas.Issue {
|
||||||
|
|
Loading…
Reference in a new issue