Kaynağa Gözat

Prevent empty headers from having a leading \r\n

Jordi Boggiano 12 yıl önce
ebeveyn
işleme
65109e6df4
1 değiştirilmiş dosya ile 1 ekleme ve 2 silme
  1. 1 2
      src/Monolog/Handler/NativeMailerHandler.php

+ 1 - 2
src/Monolog/Handler/NativeMailerHandler.php

@@ -96,7 +96,7 @@ class NativeMailerHandler extends MailHandler
     protected function send($content, array $records)
     {
         $content = wordwrap($content, $this->maxColumnWidth);
-        $headers = implode("\r\n", $this->headers) . "\r\n";
+        $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n");
         $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n";
         if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) {
             $headers .= 'MIME-Version: 1.0' . "\r\n";
@@ -133,7 +133,6 @@ class NativeMailerHandler extends MailHandler
         return $this;
     }
 
-
     /**
      * @param string $encoding
      * @return self