mirror of https://github.com/M66B/FairEmail.git
OAuth: check email before back slash
This commit is contained in:
parent
fc6debb507
commit
528720932d
|
@ -234,6 +234,11 @@ public class FragmentOAuth extends FragmentBase {
|
||||||
|
|
||||||
if (TextUtils.isEmpty(email))
|
if (TextUtils.isEmpty(email))
|
||||||
throw new IllegalArgumentException(getString(R.string.title_no_email));
|
throw new IllegalArgumentException(getString(R.string.title_no_email));
|
||||||
|
|
||||||
|
int backslash = email.indexOf('\\');
|
||||||
|
if (backslash > 0)
|
||||||
|
email = email.substring(0, backslash);
|
||||||
|
|
||||||
if (!Helper.EMAIL_ADDRESS.matcher(email).matches())
|
if (!Helper.EMAIL_ADDRESS.matcher(email).matches())
|
||||||
throw new IllegalArgumentException(getString(R.string.title_email_invalid, email));
|
throw new IllegalArgumentException(getString(R.string.title_email_invalid, email));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue