OAuth: check email before back slash

This commit is contained in:
M66B 2021-08-17 07:52:13 +02:00
parent fc6debb507
commit 528720932d
1 changed files with 5 additions and 0 deletions

View File

@ -234,6 +234,11 @@ public class FragmentOAuth extends FragmentBase {
if (TextUtils.isEmpty(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())
throw new IllegalArgumentException(getString(R.string.title_email_invalid, email));
}