mirror of https://github.com/M66B/FairEmail.git
Validate rule forward email address
This commit is contained in:
parent
ea1121b8ba
commit
cbf626ac86
|
@ -539,6 +539,8 @@ public class EntityRule {
|
||||||
String to = jargs.optString("to");
|
String to = jargs.optString("to");
|
||||||
if (TextUtils.isEmpty(to))
|
if (TextUtils.isEmpty(to))
|
||||||
throw new IllegalArgumentException(context.getString(R.string.title_rule_answer_missing));
|
throw new IllegalArgumentException(context.getString(R.string.title_rule_answer_missing));
|
||||||
|
else if (!Helper.EMAIL_ADDRESS.matcher(to).matches())
|
||||||
|
throw new IllegalArgumentException(context.getString(R.string.title_email_invalid, to));
|
||||||
} else {
|
} else {
|
||||||
EntityAnswer answer = db.answer().getAnswer(aid);
|
EntityAnswer answer = db.answer().getAnswer(aid);
|
||||||
if (answer == null)
|
if (answer == null)
|
||||||
|
|
Loading…
Reference in New Issue