]> Cypherpunks repositories - gostls13.git/commit
exp/template/html: don't normalize '<' in doctypes.
authorMike Samuel <mikesamuel@gmail.com>
Wed, 28 Sep 2011 20:32:56 +0000 (13:32 -0700)
committerMike Samuel <mikesamuel@gmail.com>
Wed, 28 Sep 2011 20:32:56 +0000 (13:32 -0700)
commit582bb304662f2da08f99bf7d05d3fbb634bb531b
tree34cc5ec9c69bcdd76c4405a779f44aa998b7786c
parent9aae6482f41de1a9cef2e039be1d668ac2c42d00
exp/template/html: don't normalize '<' in doctypes.

The normalization that prevents element name and comment injection in
  <{{.}}
by converting it to
  &lt;{{.}}
breaks
  <!DOCTYPE html>

Instead of splitting states to have a start of document state and a text
state, I whitelist <!DOCTYPE.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5131051
src/pkg/exp/template/html/escape.go
src/pkg/exp/template/html/escape_test.go