[Modify] Add it
This commit is contained in:
parent
6a3ff4964b
commit
55dc249ee5
@ -134,6 +134,27 @@ namespace WebSocketSharp.Net
|
|||||||
: -1;
|
: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string htmlAttributeEncode (string s)
|
||||||
|
{
|
||||||
|
var buff = new StringBuilder ();
|
||||||
|
|
||||||
|
foreach (var c in s) {
|
||||||
|
buff.Append (
|
||||||
|
c == '"'
|
||||||
|
? """
|
||||||
|
: c == '&'
|
||||||
|
? "&"
|
||||||
|
: c == '<'
|
||||||
|
? "<"
|
||||||
|
: c == '>'
|
||||||
|
? ">"
|
||||||
|
: c.ToString ()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buff.ToString ();
|
||||||
|
}
|
||||||
|
|
||||||
private static void initEntities ()
|
private static void initEntities ()
|
||||||
{
|
{
|
||||||
// Build the dictionary of HTML entity references.
|
// Build the dictionary of HTML entity references.
|
||||||
|
Loading…
Reference in New Issue
Block a user