File tree Expand file tree Collapse file tree
extensions/imessage/src/monitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,12 +24,11 @@ const SENT_MESSAGE_TEXT_TTL_MS = 4_000;
2424const SENT_MESSAGE_ID_TTL_MS = 60_000 ;
2525
2626// U+FFFD replacement characters and C0/C1 control characters that imsg injects when
27- // extracting text from NSAttributedString (attributedBody column). Uses RegExp constructor
28- // to keep Unicode escapes out of a regex literal (avoids no-control-regex). See: #61312, #61821
29- const IMSG_GARBAGE_CHARS_RE = new RegExp (
30- "[\\ufffd\\ufffe\\uffff\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f-\\u009f]+" ,
31- "g" ,
32- ) ;
27+ // extracting text from NSAttributedString (attributedBody column). The pattern intentionally
28+ // matches control characters to strip garbage from echo cache keys. See: #61312, #61821
29+ // eslint-disable-next-line no-control-regex
30+ const IMSG_GARBAGE_CHARS_RE =
31+ / [ \ufffd \ufffe \uffff \u0000 - \u0008 \u000b \u000c \u000e - \u001f \u007f - \u009f ] + / g;
3332
3433function normalizeEchoTextKey ( text : string | undefined ) : string | null {
3534 if ( ! text ) {
You can’t perform that action at this time.
0 commit comments