From 7dca1ae262d47cd3bfc1244b8960c0699dd986d0 Mon Sep 17 00:00:00 2001 From: Andy Hubert Date: Tue, 28 Aug 2018 05:32:45 -0400 Subject: [PATCH] fix: Validates emails before using them to identify users. (#229) --- src/transformer/utils/get_user.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transformer/utils/get_user.php b/src/transformer/utils/get_user.php index 026659643..dba9faa90 100644 --- a/src/transformer/utils/get_user.php +++ b/src/transformer/utils/get_user.php @@ -19,8 +19,9 @@ function get_user(array $config, \stdClass $user) { $fullname = get_full_name($user); + $hasvalidemail = filter_var($user->email, FILTER_VALIDATE_EMAIL); - if (array_key_exists('send_mbox', $config) && $config['send_mbox'] == true) { + if (array_key_exists('send_mbox', $config) && $config['send_mbox'] == true && $hasvalidemail) { return [ 'name' => $fullname, 'mbox' => 'mailto:' . $user->email,