mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
19 lines
478 B
C#
19 lines
478 B
C#
using System;
|
|
using System.Web;
|
|
using System.Net;
|
|
|
|
public class HtmlEncode
|
|
{
|
|
public static void Bad(HttpContext ctx)
|
|
{
|
|
var user = WebUtility.UrlDecode(ctx.Request.QueryString["user"]);
|
|
ctx.Response.Write("Hello, " + WebUtility.UrlEncode(user));
|
|
}
|
|
|
|
public static void Good(HttpContext ctx)
|
|
{
|
|
var user = WebUtility.UrlDecode(ctx.Request.QueryString["user"]);
|
|
ctx.Response.Write("Hello, " + WebUtility.HtmlEncode(user));
|
|
}
|
|
}
|