@@ -34,6 +34,7 @@ object GitHelper {
34
34
issues map (si => """ <a href="https://issues.scala-lang.org/browse/%s">%s</a>""" format (si, si)) mkString " , "
35
35
}
36
36
37
+ def htmlEncode (s : String ) = org.apache.commons.lang3.StringEscapeUtils .escapeHtml4(s)
37
38
}
38
39
39
40
class GitInfo (gitDir : java.io.File , val previousTag : String , val currentTag : String ) {
@@ -66,7 +67,7 @@ class GitInfo(gitDir: java.io.File, val previousTag: String, val currentTag: Str
66
67
| <thead><tr><th>#</th><th align="left">Author</th></tr></thead>
67
68
|<tbody>""" .stripMargin
68
69
for ((author, count) <- authors)
69
- sb append s """ <tr><td align="right"> ${count} </td><td> ${author}</td></tr> """
70
+ sb append s """ <tr><td align="right"> ${count} </td><td> ${htmlEncode( author) }</td></tr> """
70
71
sb append """ </tbody></table>"""
71
72
sb.toString
72
73
}
@@ -79,7 +80,7 @@ class GitInfo(gitDir: java.io.File, val previousTag: String, val currentTag: Str
79
80
<thead><tr><th>sha</th><th align="left">Title</th></tr></thead>
80
81
<tbody>"""
81
82
for (commit <- commits)
82
- sb append s """ <tr><td align="right"> ${commitShaLink(commit.sha)} </td><td> ${commit.header}</td></tr> """
83
+ sb append s """ <tr><td align="right"> ${commitShaLink(commit.sha)} </td><td> ${htmlEncode( commit.header) }</td></tr> """
83
84
sb append """ </tbody>
84
85
</table>"""
85
86
sb.toString
@@ -93,7 +94,7 @@ class GitInfo(gitDir: java.io.File, val previousTag: String, val currentTag: Str
93
94
<thead><tr><th>Issue(s)</th><th>Commit</th><th>Message</th></tr></thead>
94
95
<tbody>""" )
95
96
for (commit <- fixCommits)
96
- sb append s """ <tr><td> ${fixLinks(commit)} </td><td> ${commitShaLink(commit.sha)} </td><td> ${commit.header}</td></tr> """
97
+ sb append s """ <tr><td> ${fixLinks(commit)} </td><td> ${commitShaLink(commit.sha)} </td><td> ${htmlEncode( commit.header) }</td></tr> """
97
98
sb append """ </tbody>
98
99
</table>"""
99
100
sb append blankLine()
0 commit comments