]> Cypherpunks repositories - gostls13.git/commit
html/template: check "type" attribute in <script>
authorNodir Turakulov <nodir@google.com>
Sat, 5 Sep 2015 13:38:13 +0000 (06:38 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 29 Sep 2016 20:12:31 +0000 (20:12 +0000)
commitffd1c781b77aab542713b66ef387fa9307e4060b
tree03871d9d252a7301d7c0c4abac6b91d0686a4b16
parentf5516559e65175887f2fadb73cd8e5fdfc44bcd6
html/template: check "type" attribute in <script>

Currently any script tag is treated as a javascript container, although
<script type="text/template"> must not be. Check "type" attribute of
"script" tag. If it is present and it is not a JS MIME type, do not
transition to elementScript state.

Fixes #12149, where // inside text template was treated as regexp.
Fixes #6701

Change-Id: I8fc9e504f7280bdd800f40383c061853665ac8a2
Reviewed-on: https://go-review.googlesource.com/14336
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/html/template/content_test.go
src/html/template/context.go
src/html/template/escape.go
src/html/template/escape_test.go
src/html/template/js.go
src/html/template/js_test.go
src/html/template/transition.go