WordPress.org

Make WordPress Core

Ticket #43542: 43542.diff

File 43542.diff, 729 bytes (added by lbenicio, 15 months ago)
  • src/wp-includes/pluggable.php

    diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
    index 9936858ef7..9b45e12dad 100644
    a b if ( ! function_exists( 'wp_mail' ) ) : 
    456456                // Set custom headers
    457457                if ( ! empty( $headers ) ) {
    458458                        foreach ( (array) $headers as $name => $content ) {
    459                                 $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
    460                         }
     459                        // Only add custom header if not one that will be added automatically by wp-includes/class-phpmailer.php
     460                if (('MIME-Version' !== $name) && ('X-Mailer' !== $name))
     461                        $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
     462                }