]> Cypherpunks repositories - gostls13.git/commit
exp/template/html: Added handling for URL attributes.
authorMike Samuel <mikesamuel@gmail.com>
Tue, 30 Aug 2011 01:42:30 +0000 (11:42 +1000)
committerNigel Tao <nigeltao@golang.org>
Tue, 30 Aug 2011 01:42:30 +0000 (11:42 +1000)
commit22d5f9aae364f8d9d77fa67abf791b7d8046af56
tree17f6c8be031ea31611277462a30ce71a23deff0a
parentd01ee38fb09bfc9f03f5930fa2054cc767d611d2
exp/template/html: Added handling for URL attributes.

1. adds a urlPart field to context
2. implements tURL to figure out the URL part
3. modifies joinContext to allow common context mismatches
   around branches to be ignored when not material as in
   <a href="/foo{{if .HasQuery}}?q={{.Query}}{{/if}}">
4. adds a pipeline function that filters dynamically inserted
   protocols to prevent code injection via URLs.

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