Skip to content
Snippets Groups Projects
Commit 0ed1f2e4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1946090 by pjonckiere, alex-mo, rpayanm: _drupal_wrap_mail_line() does...

Issue #1946090 by pjonckiere, alex-mo, rpayanm: _drupal_wrap_mail_line() does not force-wrap too long words after 996 characters
parent 226f0020
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -327,7 +327,7 @@ protected static function wrapMailLine(&$line, $key, $values) {
$line = wordwrap($line, 77 - $values['length'], $values['soft'] ? " \n" : "\n");
}
// Break really long words at the maximum width allowed.
$line = wordwrap($line, 996 - $values['length'], $values['soft'] ? " \n" : "\n");
$line = wordwrap($line, 996 - $values['length'], $values['soft'] ? " \n" : "\n", TRUE);
}
/**
......
......@@ -346,7 +346,7 @@ public function testDrupalHtmlToTextParagraphs() {
* <CRLF> is 1000 characters."
*/
public function testVeryLongLineWrap() {
$input = 'Drupal<br /><p>' . str_repeat('x', 2100) . '</><br />Drupal';
$input = 'Drupal<br /><p>' . str_repeat('x', 2100) . '</p><br />Drupal';
$output = MailFormatHelper::htmlToText($input);
$eol = Settings::get('mail_line_endings', PHP_EOL);
......@@ -357,8 +357,7 @@ public function testVeryLongLineWrap() {
$maximum_line_length = max($maximum_line_length, strlen($line . $eol));
}
$verbose = 'Maximum line length found was ' . $maximum_line_length . ' octets.';
// @todo This should assert that $maximum_line_length <= 1000.
$this->pass($verbose);
$this->assertTrue($maximum_line_length <= 1000, $verbose);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment