File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -146,9 +146,9 @@ export class ExternalService extends Api {
146146 JSON . stringify ( {
147147 associateReplyToken,
148148 from,
149- to : ( recipients . to || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) ,
150- cc : ( recipients . cc || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) ,
151- bcc : ( recipients . bcc || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) ,
149+ to : ( recipients . to || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) . map ( Str . replaceAccentedChars ) ,
150+ cc : ( recipients . cc || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) . map ( Str . replaceAccentedChars ) ,
151+ bcc : ( recipients . bcc || [ ] ) . map ( Str . formatEmailWithOptionalName ) . map ( Xss . stripEmojis ) . map ( Str . replaceAccentedChars ) ,
152152 } )
153153 ) ,
154154 } ) ;
Original file line number Diff line number Diff line change @@ -121,6 +121,13 @@ export class Str {
121121 return str . replace ( / [ . ~ ! $ % ^ * = ? ] / gi, '' ) ;
122122 } ;
123123
124+ public static replaceAccentedChars = ( str : string ) => {
125+ /*
126+ * hotfix for issue https://github.com/FlowCrypt/enterprise-server/issues/6264
127+ */
128+ return str . normalize ( 'NFD' ) . replace ( / [ \u0300 - \u036f ] / g, '' ) ;
129+ } ;
130+
124131 public static formatEmailWithOptionalName = ( emailParts : EmailParts ) : string => {
125132 return Str . formatEmailWithOptionalNameEx ( emailParts ) ;
126133 } ;
@@ -281,6 +288,7 @@ export class Str {
281288 public static stripPgpOrGpgExtensionIfPresent = ( filename : string ) => {
282289 return filename . replace ( / \. ( p g p | g p g ) $ / i, '' ) ;
283290 } ;
291+
284292 private static formatEmailWithOptionalNameEx = ( { email, name } : EmailParts , forceBrackets ?: boolean ) : string => {
285293 if ( name ) {
286294 return `${ Str . rmSpecialCharsKeepUtf ( name , 'ALLOW-SOME' ) } <${ email } >` ;
You can’t perform that action at this time.
0 commit comments