Skip to content

Commit

Permalink
fix: Validates emails before using them to identify users. (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyHubert authored and ryasmi committed Aug 28, 2018
1 parent 2da2e11 commit 7dca1ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformer/utils/get_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7dca1ae

Please sign in to comment.