OWASP / owasp-java-encoder

The OWASP Java Encoder is a Java 1.5+ simple-to-use drop-in high-performance encoder class with no dependencies and little baggage. This project will help Java web developers defend against Cross Site Scripting!
https://owasp.org/www-project-java-encoder/
BSD 3-Clause "New" or "Revised" License
483 stars 112 forks source link

improve CDATA Encoder to not emit intermediate characters #5

Closed schueffi closed 7 years ago

schueffi commented 7 years ago

between adjacent CDATA sections.

The new behavior changes the encoding of the closing characters "]]>" in such a way that there are no intermediate character between both CDATA sections. This makes the output XML more efficient in a way that there are fewer (child) nodes, and all characters are wrapped within a CDATA-section (particular important if some XML consuming software requires all characters to be wrapped in CDATA...).

jmanico commented 7 years ago

Thank you for this excellent patch. We're going to bump the version of this project to 1.2.1 so everyone else can benefit from this. Thank you again and sorry for the delayed response.