Fix dezalgo

Changes how dezalgo works. Still filters zalgo text without breaking languages. Removes zalgo tolerance because it's not really necessary with this system.
This commit is contained in:
MangosArentLiterature 2021-04-29 22:13:06 -05:00
parent e44f687030
commit 4ca54e8761

View File

@ -770,7 +770,7 @@ AOPacket AOClient::validateIcPacket(AOPacket packet)
QString AOClient::dezalgo(QString p_text)
{
QRegExp rxp("([\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f\u115f\u1160\u3164]{" + QRegExp::escape(QString::number(server->zalgo_tolerance)) + ",})");
QRegularExpression rxp("([̴̵̶̷̸̡̢̧̨̛̖̗̘̙̜̝̞̟̠̣̤̥̦̩̪̫̬̭̮̯̰̱̲̳̹̺̻̼͇͈͉͍͎̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̽̾̿̀́͂̓̈́͆͊͋͌̕̚ͅ͏͓͔͕͖͙͚͐͑͒͗͛ͣͤͥͦͧͨͩͪͫͬͭͮͯ͘͜͟͢͝͞͠͡])");
QString filtered = p_text.replace(rxp, "");
return filtered;
}