string message = CommonFunctions.SanitiseInput(context.Request.QueryString["msg"]);
And the function is defined as:
// Sanitise input
public static string SanitiseInput(string inputText)
{
string cleanedString = inputText;
cleanedString.Replace("<","<"); // No code
cleanedString.Replace(">", ">");
cleanedString.Replace("&", "&"); // No query string breaks
return cleanedString;
}
Given input "<b>rg</b>" this returns the same, and not "<b>rg</b>"
&before replacing<and>, otherwise<will end up as&lt;and>will end up as&gt;.