[Modify] Replace it
This commit is contained in:
parent
55dc249ee5
commit
26956822d0
@ -846,23 +846,7 @@ namespace WebSocketSharp.Net
|
|||||||
if (s.Length == 0)
|
if (s.Length == 0)
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
var buff = new StringBuilder ();
|
return htmlAttributeEncode (s);
|
||||||
|
|
||||||
foreach (var c in s) {
|
|
||||||
buff.Append (
|
|
||||||
c == '&'
|
|
||||||
? "&"
|
|
||||||
: c == '"'
|
|
||||||
? """
|
|
||||||
: c == '<'
|
|
||||||
? "<"
|
|
||||||
: c == '>'
|
|
||||||
? ">"
|
|
||||||
: c.ToString ()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return buff.ToString ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void HtmlAttributeEncode (string s, TextWriter output)
|
public static void HtmlAttributeEncode (string s, TextWriter output)
|
||||||
|
Loading…
Reference in New Issue
Block a user