File tree 4 files changed +12
-4
lines changed
4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ import (
21
21
"errors"
22
22
"flag"
23
23
"fmt"
24
- "html/template"
25
24
"io/ioutil"
26
25
"log"
27
26
"os"
28
27
"path/filepath"
29
28
"regexp"
30
29
"strings"
30
+ "text/template"
31
31
"time"
32
32
33
33
"golang.org/x/sync/errgroup"
Original file line number Diff line number Diff line change 15
15
package main
16
16
17
17
import (
18
- "html/template"
19
18
"io/ioutil"
20
19
"os"
21
20
"os/exec"
22
21
"path/filepath"
23
22
"strings"
24
23
"testing"
24
+ "text/template"
25
25
)
26
26
27
27
func run (t * testing.T , name string , args ... string ) {
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ import (
18
18
"bufio"
19
19
"bytes"
20
20
"fmt"
21
- "html/template"
22
21
"io/ioutil"
23
22
"strings"
23
+ "text/template"
24
24
"unicode"
25
25
)
26
26
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ package main
16
16
17
17
import (
18
18
"errors"
19
- "html/template"
20
19
"os"
21
20
"testing"
21
+ "text/template"
22
22
)
23
23
24
24
func init () {
@@ -170,6 +170,14 @@ func TestExecuteTemplate(t *testing.T) {
170
170
"/*" , " * " , "*/" ,
171
171
"/*\n * HYS\n */\n \n " ,
172
172
},
173
+
174
+ // ensure we don't escape HTML characters by using the wrong template package
175
+ {
176
+ "{{.Holder}}" ,
177
+ licenseData {Holder : "A&Z" },
178
+ "" , "" , "" ,
179
+ "A&Z\n \n " ,
180
+ },
173
181
}
174
182
175
183
for _ , tt := range tests {
You can’t perform that action at this time.
0 commit comments