]> Cypherpunks repositories - gostls13.git/commit
encoding/xml: improve marshaller sanity checks of directives
authorDidier Spezia <didier.06@gmail.com>
Sat, 27 Jun 2015 13:07:22 +0000 (13:07 +0000)
committerRuss Cox <rsc@golang.org>
Wed, 15 Jul 2015 01:56:14 +0000 (01:56 +0000)
commit8b6527b70ea0408f0903a51d88c7245ec366f1f5
tree9d45d64c78fad6c6cbdacbea5c5ef7aeb980a609
parentaed74b9ddf95a3cc824a50f8e222b8edf07b3b52
encoding/xml: improve marshaller sanity checks of directives

When building a directive, the current sanity check prevents
a '>' to be used, which makes a DOCTYPE directive with an
internal subset be rejected. It is accepted by the parser
though, so what can be parsed cannot be encoded.

Improved the corresponding sanity check to mirror the behavior
of the parser (in the way it handles angle brackets, quotes,
and comments).

Fixes #10158

Change-Id: Ieffea9f870f2694548e12897f8f47babc0ea4414
Reviewed-on: https://go-review.googlesource.com/11630
Reviewed-by: Russ Cox <rsc@golang.org>
src/encoding/xml/marshal.go
src/encoding/xml/marshal_test.go