protected virtual bool IsEmailValid(string email) { return(!string.IsNullOrEmpty(email) && // If username is empty email == email.Replace(" ", "") && !BadWordFilter.ContainsBadWords(email) && email.Contains("@") && email.Contains(".")); // If username contains spaces }
public void Initialize() { filter = new BadWordFilter(new PluginLoadData("BadWordFilter", new NameValueCollection(), new DarkRiftInfo(DateTime.Now), new DarkRiftThreadHelper(false, null), (Logger)null, Path.GetTempPath())); //Populate with a set list of words here filter.PopulateBadWords(new string[] { "poop", "crap" }); }