Skip to content
Snippets Groups Projects
Verified Commit 5be98c43 authored by Dave Long's avatar Dave Long
Browse files

Issue #3451611 by mfb, xjm, smustgrave, quietone: Fix the format=flowed;...

Issue #3451611 by mfb, xjm, smustgrave, quietone: Fix the format=flowed; delsp=yes encoding of email messages

(cherry picked from commit c29768f4)
parent 32075e1a
No related branches found
No related tags found
11 merge requests!10602Issue #3438769 by vinmayiswamy, antonnavi, michelle, amateescu: Sub workspace does not clear,!10301Issue #3469309 by mstrelan, smustgrave, moshe weitzman: Use one-time login...,!10187Issue #3487488 by dakwamine: ExtensionMimeTypeGuesser::guessMimeType must support file names with "0" (zero) like foo.0.zip,!9929Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9787Resolve issue 3479427 - bootstrap barrio issue under Windows,!9742Issue #3463908 by catch, quietone: Split OptionsFieldUiTest into two,!9526Issue #3458177 by mondrake, catch, quietone, godotislate, longwave, larowlan,...,!8949Backport .gitlabci.yml changes.,!6502Draft: Resolve #2938524 "Plach testing issue",!38582585169-10.1.x,!3226Issue #2987537: Custom menu link entity type should not declare "bundle" entity key
Pipeline #231035 passed with warnings
Pipeline: drupal

#231062

    Pipeline: drupal

    #231057

      Pipeline: drupal

      #231050

        +1
        ......@@ -311,7 +311,7 @@ protected static function wrapMailLine(&$line, $key, $values) {
        }
        if (!$line_is_mime_header) {
        // Use soft-breaks only for purely quoted or un-indented text.
        $line = wordwrap($line, 77 - $values['length'], $values['soft'] ? " \n" : "\n");
        $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", TRUE);
        ......
        ......@@ -64,10 +64,8 @@ public function format(array $message) {
        // Join the body array into one string.
        $message['body'] = implode("\n\n", $message['body']);
        // Convert any HTML to plain-text.
        // Convert any HTML to plain text (which also wraps the mail body).
        $message['body'] = MailFormatHelper::htmlToText($message['body']);
        // Wrap the mail body for sending.
        $message['body'] = MailFormatHelper::wrapMail($message['body']);
        return $message;
        }
        ......
        ......@@ -98,11 +98,14 @@ public function __construct(
        }
        public function format(array $message) {
        // Convert any HTML to plain-text.
        foreach ($message['body'] as &$part) {
        // If the message contains HTML, convert it to plain text (which also
        // wraps the mail body).
        if ($part instanceof MarkupInterface) {
        $part = MailFormatHelper::htmlToText($part);
        }
        // If the message does not contain HTML, it still needs to be wrapped
        // properly.
        else {
        $part = MailFormatHelper::wrapMail($part);
        }
        ......
        ......@@ -32,8 +32,11 @@ public function testWrapMail(): void {
        // Check that the body headers were not wrapped even though some exceeded
        // 77 characters.
        $this->assertEquals($headers_in_body, $processed_headers, 'Headers in the body are not wrapped.');
        // Check that the body text is wrapped.
        $this->assertEquals(wordwrap($body, 77, " \n"), $processed_body, 'Body text is wrapped.');
        // Check that the body text is soft-wrapped according to the
        // "format=flowed; delsp=yes" encoding. When interpreting this encoding,
        // mail readers will delete a space at the end of the line; therefore an
        // extra trailing space should be present in the raw body (see RFC 3676).
        $this->assertEquals(wordwrap($body, 77, " \n"), $processed_body, 'Body text is soft-wrapped.');
        }
        }
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Finish editing this message first!
        Please register or to comment