+2004-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TraceData.cs: html-encode the messages written to the trace. Fixes
+ bug #59431.
+
2004-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* HttpWorkerRequest.cs: the hashtables are now case-insensitive. Thanks
DataRow r = info.NewRow ();
r ["Category"] = category;
- r ["Message"] = msg;
+ r ["Message"] = HtmlEncode (msg);
r ["Exception"] = (error != null ? error.ToString () : null);
r ["TimeSinceFirst"] = time;
r ["IsWarning"] = Warning;
info.Rows.Add (r);
}
+ static string HtmlEncode (string s)
+ {
+ if (s == null)
+ return s;
+
+ string res = HttpUtility.HtmlEncode (s);
+ res = res.Replace ("\r\n", "<br />");
+ return res.Replace (" ", " ");
+ }
+
public void AddControlTree (Page page)
{
AddControl (page, 0);