mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
21 lines
513 B
C#
21 lines
513 B
C#
|
|
|
|
using System;
|
|
using System.Web;
|
|
using System.Net;
|
|
|
|
public class UrlEncode
|
|
{
|
|
public static void Bad(string value, HttpContext ctx)
|
|
{
|
|
var user = WebUtility.UrlDecode(ctx.Request.QueryString["user"]);
|
|
ctx.Response.Redirect("?param=" + WebUtility.HtmlEncode(user));
|
|
}
|
|
|
|
public static void Good(string value, HttpContext ctx)
|
|
{
|
|
var user = WebUtility.UrlDecode(ctx.Request.QueryString["user"]);
|
|
ctx.Response.Redirect("?param=" + WebUtility.UrlEncode(user));
|
|
}
|
|
}
|