WordPress.org

Make WordPress Core

Ticket #19549: phpmailer-block-x-headers.diff

File phpmailer-block-x-headers.diff, 1.2 KB (added by westi, 2 years ago)

Simple solution to block x- headers

  • wp-includes/class-phpmailer.php

     
    11901190    } else { 
    11911191      $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE); 
    11921192    } 
    1193     $result .= $this->HeaderLine('X-Priority', $this->Priority); 
    1194     if($this->XMailer) { 
    1195       $result .= $this->HeaderLine('X-Mailer', $this->XMailer); 
    1196     } else { 
    1197       $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)'); 
     1193    // To disable sending these optional X- headers set the values to false 
     1194    if ( false !== $this->Priority ) 
     1195        $result .= $this->HeaderLine('X-Priority', $this->Priority); 
     1196    if ( false !== $this->XMailer ) { 
     1197        if($this->XMailer) { 
     1198          $result .= $this->HeaderLine('X-Mailer', $this->XMailer); 
     1199        } else { 
     1200          $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)'); 
     1201        } 
    11981202    } 
    11991203 
    12001204    if($this->ConfirmReadingTo != '') {