]> Cypherpunks repositories - gostls13.git/commit
html/template: fix crash when escaping incomplete template
authorRob Pike <r@golang.org>
Fri, 20 Mar 2015 17:47:52 +0000 (10:47 -0700)
committerRob Pike <r@golang.org>
Fri, 20 Mar 2015 19:57:45 +0000 (19:57 +0000)
commit11dba2ec2d8fcedc1da0103925c254586ef51120
tree1d66a39e3293847dae8d3c52d7237fce58338318
parent3f12d271335abc9d49d419247528cf286a04f9a6
html/template: fix crash when escaping incomplete template

text/template turned this into an error but html/template crashed.
Refactor text/template.Execute to export a new function,
text/template.DefinedTemplates, so html/template can get the same
helpful error message in this case, and invoke it when there is no
definition for a template being escaped.

Fixes #10204.

Change-Id: I1d04e9e7ebca829bc08509caeb65e75da969711f
Reviewed-on: https://go-review.googlesource.com/7855
Reviewed-by: Russ Cox <rsc@golang.org>
src/html/template/escape_test.go
src/html/template/template.go
src/text/template/exec.go