]> Cypherpunks repositories - gostls13.git/commit
text/template: check for malformed pipelines
authorDidier Spezia <didier.06@gmail.com>
Tue, 5 May 2015 06:45:49 +0000 (06:45 +0000)
committerRob Pike <r@golang.org>
Tue, 5 May 2015 23:03:54 +0000 (23:03 +0000)
commit62fb472b71e1600f073203a3b723a6a4c6e8ba3b
tree76e3a72b81898e55748d328b13642c1d50dbd7ac
parentde6d5b080120074747baddd239869e2cb1fbe55d
text/template: check for malformed pipelines

Catch some malformed pipelines at parsing time.
The current code accepts pipelines such as:

{{12|.}}
{{"hello"|print|false}}
{{.|"blah blah"}}

Such pipelines generate panic in html/template at execution time.

Add an extra check to verify all the commands of the pipeline are executable
(except for the first one).

Fixes #10610

Change-Id: Id72236ba8f76a59fa284fe3d4c2cb073e50b51f1
Reviewed-on: https://go-review.googlesource.com/9626
Reviewed-by: Rob Pike <r@golang.org>
src/text/template/parse/parse.go
src/text/template/parse/parse_test.go