1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

have graph color generated by css so that MS Edge doesn't freak out when using rgba

don't do simple word check on offensive name
This commit is contained in:
RaidMax
2019-08-10 17:35:34 -05:00
parent c2b5aed8cd
commit d5cece04f7
3 changed files with 21 additions and 23 deletions

View File

@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using SharedLibraryCore;
@ -31,19 +29,15 @@ namespace IW4MAdmin.Plugins.ProfanityDeterment
E.Origin.SetAdditionalProperty("_profanityInfringements", 0);
var objectionalWords = Settings.Configuration().OffensiveWords;
bool containsObjectionalWord = objectionalWords.FirstOrDefault(w => E.Origin.Name.ToLower().Contains(w)) != null;
var matchedFilters = new List<string>();
bool containsObjectionalWord = false;
// we want to run regex against it just incase
if (!containsObjectionalWord)
foreach (string word in objectionalWords)
{
foreach (string word in objectionalWords)
if (Regex.IsMatch(E.Origin.Name.ToLower(), word, RegexOptions.IgnoreCase))
{
if (Regex.IsMatch(E.Origin.Name.ToLower(), word, RegexOptions.IgnoreCase))
{
containsObjectionalWord |= true;
matchedFilters.Add(word);
}
containsObjectionalWord |= true;
matchedFilters.Add(word);
}
}