X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FMail%2FMailManager.php;h=5cf3c9ea05b1b0e0872235941c05659ac43ef054;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=bbc0432c6da4df16c23f6f6a6127d81af1b38a06;hpb=0bf8d09d2542548982e81a441b1f16e75873a04f;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Mail/MailManager.php b/web/core/lib/Drupal/Core/Mail/MailManager.php index bbc0432c6..5cf3c9ea0 100644 --- a/web/core/lib/Drupal/Core/Mail/MailManager.php +++ b/web/core/lib/Drupal/Core/Mail/MailManager.php @@ -5,7 +5,7 @@ namespace Drupal\Core\Mail; use Drupal\Component\Render\MarkupInterface; use Drupal\Component\Render\PlainTextOutput; use Drupal\Component\Utility\Html; -use Drupal\Component\Utility\Unicode; +use Drupal\Component\Utility\Mail as MailHelper; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Messenger\MessengerTrait; use Drupal\Core\Plugin\DefaultPluginManager; @@ -254,12 +254,8 @@ class MailManager extends DefaultPluginManager implements MailManagerInterface { // Return-Path headers should have a domain authorized to use the // originating SMTP server. $headers['Sender'] = $headers['Return-Path'] = $site_mail; - // Headers are usually encoded in the mail plugin that implements - // \Drupal\Core\Mail\MailInterface::mail(), for example, - // \Drupal\Core\Mail\Plugin\Mail\PhpMail::mail(). The site name must be - // encoded here to prevent mail plugins from encoding the email address, - // which would break the header. - $headers['From'] = Unicode::mimeHeaderEncode($site_config->get('name'), TRUE) . ' <' . $site_mail . '>'; + // Make sure the site-name is a RFC-2822 compliant 'display-name'. + $headers['From'] = MailHelper::formatDisplayName($site_config->get('name')) . ' <' . $site_mail . '>'; if ($reply) { $headers['Reply-to'] = $reply; }