rspec/rules/S5247/java/rule.adoc
2021-01-27 12:07:43 +01:00

33 lines
720 B
Plaintext

include::../description.adoc[]
include::../ask-yourself.adoc[]
include::../recommended.adoc[]
== Sensitive Code Example
With https://github.com/samskivert/jmustache[JMustache by samskivert]:
----
Mustache.compiler().escapeHTML(false).compile(template).execute(context); // Sensitive
Mustache.compiler().withEscaper(Escapers.NONE).compile(template).execute(context); // Sensitive
----
With https://freemarker.apache.org/[Freemarker]:
----
TODO
----
== Compliant Solution
----
Mustache.compiler().compile(template).execute(context); // Compliant, auto-escaping is enabled by default
Mustache.compiler().escapeHTML(true).compile(template).execute(context); // Compliant
----
----
TODO
----
include::../see.adoc[]