From 0da679fae695985f40f97002c661ee6e633b5c0f Mon Sep 17 00:00:00 2001 From: celestora Date: Fri, 17 Feb 2023 14:53:45 +0200 Subject: [PATCH] Use simpler regex in TRichText::removeZalgo lmao i forgor character class selectors are a thing --- Web/Models/Entities/Traits/TRichText.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Models/Entities/Traits/TRichText.php b/Web/Models/Entities/Traits/TRichText.php index 7ea119e6..05ab2dd4 100644 --- a/Web/Models/Entities/Traits/TRichText.php +++ b/Web/Models/Entities/Traits/TRichText.php @@ -49,7 +49,7 @@ trait TRichText private function removeZalgo(string $text): string { - return preg_replace("%[\x{0300}-\x{036F}]{3,}%Xu", "�", $text); + return preg_replace("%\p{M}{3,}%Xu", "�", $text); } function resolveMentions(array $skipUsers = []): \Traversable