Lower case with root locale

pull/198/head
M66B 4 years ago
parent 23121ac172
commit 9cba293ca2

@ -390,7 +390,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
return null;
if (attr.startsWith("\\")) {
int index = SYSTEM_FOLDER_ATTR.indexOf(attr.substring(1).toLowerCase());
int index = SYSTEM_FOLDER_ATTR.indexOf(attr.substring(1).toLowerCase(Locale.ROOT));
if (index >= 0)
return SYSTEM_FOLDER_TYPE.get(index);
}

@ -31,6 +31,7 @@ import androidx.room.PrimaryKey;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Locale;
import java.util.Objects;
import java.util.regex.Pattern;
@ -167,7 +168,7 @@ public class EntityIdentity {
if (user.equalsIgnoreCase(cemail[0]))
return true;
} else {
String input = (sender_extra_regex.contains("@") ? other.toLowerCase() : cother[0]);
String input = (sender_extra_regex.contains("@") ? other.toLowerCase(Locale.ROOT) : cother[0]);
if (Pattern.matches(sender_extra_regex, input))
return true;
}

@ -2057,7 +2057,7 @@ public class FragmentCompose extends FragmentBase {
List<String> emails = new ArrayList<>();
for (int i = 0; i < recipients.size(); i++) {
InternetAddress recipient = (InternetAddress) recipients.get(i);
String email = recipient.getAddress().toLowerCase();
String email = recipient.getAddress().toLowerCase(Locale.ROOT);
if (!emails.contains(email))
emails.add(email);
}
@ -2677,7 +2677,7 @@ public class FragmentCompose extends FragmentBase {
Intent intent = new Intent(OpenPgpApi.ACTION_GET_KEY);
intent.putExtra(OpenPgpApi.EXTRA_KEY_ID, pgpSignKeyId);
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE, true);
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE_USER_ID, identity.email.toLowerCase());
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE_USER_ID, identity.email.toLowerCase(Locale.ROOT));
intent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
intent.putExtra(BuildConfig.APPLICATION_ID, largs);
return intent;
@ -2697,7 +2697,7 @@ public class FragmentCompose extends FragmentBase {
Intent intent = new Intent(OpenPgpApi.ACTION_GET_KEY);
intent.putExtra(OpenPgpApi.EXTRA_KEY_ID, pgpSignKeyId);
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE, true);
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE_USER_ID, identity.email.toLowerCase());
intent.putExtra(OpenPgpApi.EXTRA_MINIMIZE_USER_ID, identity.email.toLowerCase(Locale.ROOT));
intent.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
intent.putExtra(BuildConfig.APPLICATION_ID, largs);
return intent;
@ -4969,7 +4969,7 @@ public class FragmentCompose extends FragmentBase {
String[] userIds = new String[recipients.size()];
for (int i = 0; i < recipients.size(); i++) {
InternetAddress recipient = (InternetAddress) recipients.get(i);
userIds[i] = recipient.getAddress().toLowerCase();
userIds[i] = recipient.getAddress().toLowerCase(Locale.ROOT);
}
Intent intent = new Intent(OpenPgpApi.ACTION_GET_KEY_IDS);

@ -75,6 +75,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.mail.AuthenticationFailedException;
@ -688,7 +689,7 @@ public class FragmentOAuth extends FragmentBase {
if (ex instanceof AuthenticationFailedException)
tvOfficeAuthHint.setVisibility(View.VISIBLE);
String e = etEmail.getText().toString().toLowerCase();
String e = etEmail.getText().toString().toLowerCase(Locale.ROOT);
if (e.contains("@outlook") ||
e.contains("@live") ||
e.contains("@hotmail") ||

@ -1739,7 +1739,7 @@ public class HtmlHelper {
for (int i = 0; i < param.length; i++) {
String[] kv = param[i].split("=");
if (kv.length == 2) {
switch (kv[0].replace(" ", "").toLowerCase()) {
switch (kv[0].replace(" ", "").toLowerCase(Locale.ROOT)) {
case "user-scalable":
kv[1] = "yes";
param[i] = TextUtils.join("=", kv);

@ -2826,9 +2826,9 @@ public class MessageHelper {
String email1 = ((InternetAddress) a1).getAddress();
String email2 = ((InternetAddress) a2).getAddress();
if (email1 != null)
email1 = email1.toLowerCase();
email1 = email1.toLowerCase(Locale.ROOT);
if (email2 != null)
email2 = email2.toLowerCase();
email2 = email2.toLowerCase(Locale.ROOT);
return Objects.equals(email1, email2);
}

Loading…
Cancel
Save