Browse Source

Sanitize email name

main
M66B 6 years ago
parent
commit
ebf41cdc76
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      app/src/main/java/eu/faircode/email/MessageHelper.java

+ 7
- 4
app/src/main/java/eu/faircode/email/MessageHelper.java View File

@ -268,10 +268,13 @@ public class MessageHelper {
String personal = a.getPersonal(); String personal = a.getPersonal();
if (TextUtils.isEmpty(personal)) if (TextUtils.isEmpty(personal))
formatted.add(address.toString()); formatted.add(address.toString());
else if (full)
formatted.add(personal + " <" + a.getAddress() + ">");
else
formatted.add(personal);
else {
personal = personal.replaceAll("[\\,\\<\\>]", "");
if (full)
formatted.add(personal + " <" + a.getAddress() + ">");
else
formatted.add(personal);
}
} else } else
formatted.add(address.toString()); formatted.add(address.toString());
return TextUtils.join(", ", formatted); return TextUtils.join(", ", formatted);


Loading…
Cancel
Save