From 528720932dd31ca9c2355c9534a7aa7fb5fcfb51 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 17 Aug 2021 07:52:13 +0200 Subject: [PATCH] OAuth: check email before back slash --- app/src/main/java/eu/faircode/email/FragmentOAuth.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentOAuth.java b/app/src/main/java/eu/faircode/email/FragmentOAuth.java index 2d59c2feda..b85a07784b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOAuth.java +++ b/app/src/main/java/eu/faircode/email/FragmentOAuth.java @@ -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)); }