]> Cypherpunks repositories - gostls13.git/commit
html/template: check for duplicates when inserting escapers
authorSamuel Tan <samueltan@google.com>
Thu, 14 Dec 2017 06:38:18 +0000 (22:38 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 10 Jan 2018 17:36:27 +0000 (17:36 +0000)
commitc9517688c7dbe224bd606050dd7511ad1b10f55a
tree917efbae0a5cdb457811993949bfd06a1e1bc484
parentdbdeeed02e27e3c3b258230793adbecfc4f9d6b7
html/template: check for duplicates when inserting escapers

Ensure that we do not insert any escapers into pipelines that
already contain an equivalent escaper. This prevents overescaping
from occuring even when an aliased parse tree that has already
been escaped is escaped again.

Fixes #21844

Change-Id: Ic00d5e01c97ef09a4e49407009cf71b0d07f5c0e
Reviewed-on: https://go-review.googlesource.com/83920
Reviewed-by: Russ Cox <rsc@golang.org>
src/html/template/escape.go
src/html/template/escape_test.go