[Modify] Add it

This commit is contained in:
sta 2018-09-28 19:38:55 +09:00
parent 6a3ff4964b
commit 55dc249ee5

View File

@ -134,6 +134,27 @@ namespace WebSocketSharp.Net
: -1;
}
private static string htmlAttributeEncode (string s)
{
var buff = new StringBuilder ();
foreach (var c in s) {
buff.Append (
c == '"'
? """
: c == '&'
? "&"
: c == '<'
? "&lt;"
: c == '>'
? "&gt;"
: c.ToString ()
);
}
return buff.ToString ();
}
private static void initEntities ()
{
// Build the dictionary of HTML entity references.