diff --git a/core/lib/Drupal/Core/Mail/MailFormatHelper.php b/core/lib/Drupal/Core/Mail/MailFormatHelper.php index 431c846ceec..12b956ceac2 100644 --- a/core/lib/Drupal/Core/Mail/MailFormatHelper.php +++ b/core/lib/Drupal/Core/Mail/MailFormatHelper.php @@ -142,8 +142,6 @@ class MailFormatHelper { // required). // Odd/even counter (tag or no tag). $tag = FALSE; - // Case conversion function. - $casing = NULL; $output = ''; // All current indentation string chunks. $indent = []; @@ -221,17 +219,14 @@ class MailFormatHelper { // Fancy headers. case 'h1': $indent[] = '======== '; - $casing = 'mb_strtoupper'; break; case 'h2': $indent[] = '-------- '; - $casing = 'mb_strtoupper'; break; case '/h1': case '/h2': - $casing = NULL; // Pad the line with dashes. $output = static::htmlToTextPad($output, ($tagname == '/h1') ? '=' : '-', ' '); array_pop($indent); @@ -266,10 +261,6 @@ class MailFormatHelper { // See if there is something waiting to be output. if (isset($chunk)) { - // Apply any necessary case conversion. - if (isset($casing)) { - $chunk = call_user_func($casing, $chunk); - } $line_endings = Settings::get('mail_line_endings', PHP_EOL); // Format it and apply the current indentation. $output .= static::wrapMail($chunk, implode('', $indent)) . $line_endings; diff --git a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php index 59d7e07e921..46dec8b2002 100644 --- a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php +++ b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php @@ -85,10 +85,10 @@ class HtmlToTextTest extends BrowserTestBase { // @todo The
tag is currently not supported. '
Drupal
Drupal
' => "DrupalDrupal\n", 'Drupal' => "/Drupal/\n", - '

Drupal

' => "======== DRUPAL ==============================================================\n\n", - '

Drupal

Drupal

' => "======== DRUPAL ==============================================================\n\nDrupal\n\n", - '

Drupal

' => "-------- DRUPAL --------------------------------------------------------------\n\n", - '

Drupal

Drupal

' => "-------- DRUPAL --------------------------------------------------------------\n\nDrupal\n\n", + '

Drupal

' => "======== Drupal ==============================================================\n\n", + '

Drupal

Drupal

' => "======== Drupal ==============================================================\n\nDrupal\n\n", + '

Drupal

' => "-------- Drupal --------------------------------------------------------------\n\n", + '

Drupal

Drupal

' => "-------- Drupal --------------------------------------------------------------\n\nDrupal\n\n", '

Drupal

' => ".... Drupal\n\n", '

Drupal

Drupal

' => ".... Drupal\n\nDrupal\n\n", '

Drupal

' => ".. Drupal\n\n", @@ -247,21 +247,21 @@ EOT; public function testHeaderSeparation() { $html = 'Drupal

Drupal

Drupal'; // @todo There should be more space above the header than below it. - $text = "Drupal\n======== DRUPAL ==============================================================\n\nDrupal\n"; + $text = "Drupal\n======== Drupal ==============================================================\n\nDrupal\n"; $this->assertHtmlToText($html, $text, 'Text before and after

tag'); $html = '

Drupal

Drupal

Drupal'; // @todo There should be more space above the header than below it. - $text = "Drupal\n\n======== DRUPAL ==============================================================\n\nDrupal\n"; + $text = "Drupal\n\n======== Drupal ==============================================================\n\nDrupal\n"; $this->assertHtmlToText($html, $text, 'Paragraph before and text after

tag'); $html = 'Drupal

Drupal

Drupal

'; // @todo There should be more space above the header than below it. - $text = "Drupal\n======== DRUPAL ==============================================================\n\nDrupal\n\n"; + $text = "Drupal\n======== Drupal ==============================================================\n\nDrupal\n\n"; $this->assertHtmlToText($html, $text, 'Text before and paragraph after

tag'); $html = '

Drupal

Drupal

Drupal

'; - $text = "Drupal\n\n======== DRUPAL ==============================================================\n\nDrupal\n\n"; + $text = "Drupal\n\n======== Drupal ==============================================================\n\nDrupal\n\n"; $this->assertHtmlToText($html, $text, 'Paragraph before and after

tag'); }