ReplaceEntities replaces XML entities in the document according to the entity declarations in the DOCTYPE. It modifies the document in place. Entities are replaced only once to avoid attacks like the "Billion Laughs" XML entity expansion attack.
()
| 31 | // Entities are replaced only once to avoid attacks like the |
| 32 | // "Billion Laughs" XML entity expansion attack. |
| 33 | func (doc *Document) ReplaceEntities() { |
| 34 | if em := ParseEntityMap(doc.Children); em != nil { |
| 35 | doc.replaceEntities(em) |
| 36 | } |
| 37 | } |