mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Added support for HTML entities encoding and decoding.
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Data;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -66,6 +67,12 @@ namespace RuriLib
|
|||||||
/// <summary>Decodes a URL-encoded input.</summary>
|
/// <summary>Decodes a URL-encoded input.</summary>
|
||||||
URLDecode,
|
URLDecode,
|
||||||
|
|
||||||
|
/// <summary>Encodes the input to be displayed in HTML or XML.</summary>
|
||||||
|
HTMLEntityEncode,
|
||||||
|
|
||||||
|
/// <summary>Decoded an input containing HTML or XML entities.</summary>
|
||||||
|
HTMLEntityDecode,
|
||||||
|
|
||||||
/// <summary>Converts a unix timestamp to a formatted date.</summary>
|
/// <summary>Converts a unix timestamp to a formatted date.</summary>
|
||||||
UnixTimeToDate,
|
UnixTimeToDate,
|
||||||
|
|
||||||
@@ -500,6 +507,14 @@ namespace RuriLib
|
|||||||
outputString = Base64Decode(localInputString);
|
outputString = Base64Decode(localInputString);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Function.HTMLEntityEncode:
|
||||||
|
outputString = WebUtility.HtmlEncode(localInputString);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Function.HTMLEntityDecode:
|
||||||
|
outputString = WebUtility.HtmlDecode(localInputString);
|
||||||
|
break;
|
||||||
|
|
||||||
case Function.Hash:
|
case Function.Hash:
|
||||||
outputString = GetHash(localInputString, hashType).ToLower();
|
outputString = GetHash(localInputString, hashType).ToLower();
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user