Validate rule forward email address

This commit is contained in:
M66B 2022-04-01 11:53:49 +02:00
parent ea1121b8ba
commit cbf626ac86
1 changed files with 2 additions and 0 deletions

View File

@ -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)