Protect against zero-width chars in display name sanitation (see https://github.com/bluesky-social/social-app/pull/5703#issuecomment-2407459187) (#5729)

This commit is contained in:
Paul Frazee
2024-10-11 14:41:12 -07:00
committed by GitHub
parent 7e5c522718
commit f7852d02ba
+1 -1
View File
@@ -7,7 +7,7 @@ import {ModerationUI} from '@atproto/api'
const CHECK_MARKS_RE = /[\u2705\u2713\u2714\u2611]/gu
const CONTROL_CHARS_RE =
/[\u0000-\u001F\u007F-\u009F\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g
const MULTIPLE_SPACES_RE = /[\s][\s]+/g
const MULTIPLE_SPACES_RE = /[\s][\s\u200B]+/g
export function sanitizeDisplayName(
str: string,