diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 04:44:54 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-03-27 04:44:54 +0000 |
commit | 9eff5d958866cd44f379a45b6ce3ec0d5f50496d (patch) | |
tree | 8f166e403fc4e0f7193391f6a36260d6717995d7 /modules/system | |
parent | 2b2980261c4a0d40d9fbccc19daa71b7361c484b (diff) | |
download | brdo-9eff5d958866cd44f379a45b6ce3ec0d5f50496d.tar.gz brdo-9eff5d958866cd44f379a45b6ce3ec0d5f50496d.tar.bz2 |
#714190 by rfay: Fixed system_send_email_action() uses account without initializing it.
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.module | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index a8e57d924..aa7ff01db 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2961,7 +2961,16 @@ function system_send_email_action($entity, $context) { $recipient = token_replace($context['recipient'], $context); - $language = user_preferred_language($account); + // If the recipient is a registered user with a language preference, use + // the recipient's preferred language. Otherwise, use the system default + // language. + $recipient_account = user_load_by_mail($recipient); + if ($recipient_account) { + $language = user_preferred_language($recipient_account); + } + else { + $language = language_default(); + } $params = array('context' => $context); if (drupal_mail('system', 'action_send_email', $recipient, $language, $params)) { |