Commit fa3b0568 authored by alexpott's avatar alexpott
Browse files

Issue #2361757 by rpayanm: Remove usage of mime_header_encode().

parent 579fdc4c
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\Core\Mail\Plugin\Mail; namespace Drupal\Core\Mail\Plugin\Mail;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Mail\MailInterface; use Drupal\Core\Mail\MailInterface;
use Drupal\Core\Site\Settings; use Drupal\Core\Site\Settings;
...@@ -65,11 +66,11 @@ public function mail(array $message) { ...@@ -65,11 +66,11 @@ public function mail(array $message) {
} }
$mimeheaders = array(); $mimeheaders = array();
foreach ($message['headers'] as $name => $value) { foreach ($message['headers'] as $name => $value) {
$mimeheaders[] = $name . ': ' . mime_header_encode($value); $mimeheaders[] = $name . ': ' . Unicode::mimeHeaderEncode($value);
} }
$line_endings = Settings::get('mail_line_endings', PHP_EOL); $line_endings = Settings::get('mail_line_endings', PHP_EOL);
// Prepare mail commands. // Prepare mail commands.
$mail_subject = mime_header_encode($message['subject']); $mail_subject = Unicode::mimeHeaderEncode($message['subject']);
// Note: email uses CRLF for line-endings. PHP's API requires LF // Note: email uses CRLF for line-endings. PHP's API requires LF
// on Unix and CRLF on Windows. Drupal automatically guesses the // on Unix and CRLF on Windows. Drupal automatically guesses the
// line-ending format appropriate for your system. If you need to // line-ending format appropriate for your system. If you need to
......
...@@ -532,7 +532,7 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM ...@@ -532,7 +532,7 @@ function file_save_data($data, $destination = NULL, $replace = FILE_EXISTS_RENAM
* \Symfony\Component\HttpFoundation\StreamedResponse. * \Symfony\Component\HttpFoundation\StreamedResponse.
*/ */
function file_get_content_headers(FileInterface $file) { function file_get_content_headers(FileInterface $file) {
$type = mime_header_encode($file->getMimeType()); $type = Unicode::mimeHeaderEncode($file->getMimeType());
return array( return array(
'Content-Type' => $type, 'Content-Type' => $type,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment