rspec/rules/S5131/csharp/rule.adoc

27 lines
536 B
Plaintext
Raw Normal View History

2020-06-30 12:50:28 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
string name = Request.QueryString["name"];
Response.Write("Hello " + name); // Noncompliant
----
== Compliant Solution
----
string name = Request.QueryString["name"];
name = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(name, true);
Response.Write("Hello " + name);
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]