using System;
using System.Configuration;
using System.Globalization;
using System.Linq;
using System.Net.Mail;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Security;
using RestSharp;
using RestSharp.Deserializers;
using umbraco;
using umbraco.BusinessLogic;
using Umbraco.Core.Models;
using Member = umbraco.cms.businesslogic.member.Member;
using MemberGroup = umbraco.cms.businesslogic.member.MemberGroup;
namespace uForum.Library
{
public class Utils
{
private const string SpamMemberGroupName = "potentialspam";
private static readonly int PotentialSpammerThreshold = int.Parse(ConfigurationManager.AppSettings["PotentialSpammerThreshold"]);
private static readonly int SpamBlockThreshold = int.Parse(ConfigurationManager.AppSettings["SpamBlockThreshold"]);
private const int ReputationThreshold = 30;
///
/// sanitize any potentially dangerous tags from the provided raw HTML input using
/// a whitelist based approach, leaving the "safe" HTML tags
///
public static string Sanitize(string html)
{
html = Regex.Replace(html, "", "", RegexOptions.Singleline | RegexOptions.IgnoreCase);
html = Regex.Replace(html, "