MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / ReplaceEntities

Method ReplaceEntities

xmlparser/document.go:33–37  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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

Callers 1

TestEntityReplacementFunction · 0.95

Calls 2

ParseEntityMapFunction · 0.85
replaceEntitiesMethod · 0.80

Tested by 1

TestEntityReplacementFunction · 0.76