Ejemplo n.º 1
0
 /**
  * Encode header fields
  *
  * Encodes header content according to RFC1522 if it contains non-printable
  * characters.
  *
  * @param  string $value
  * @return string
  */
 protected function _encodeHeader($value)
 {
     if (Mime\Mime::isPrintable($value) === false) {
         if ($this->getHeaderEncoding() === Mime\Mime::ENCODING_QUOTEDPRINTABLE) {
             $value = Mime\Mime::encodeQuotedPrintableHeader($value, $this->getCharset(), Mime\Mime::LINELENGTH, Mime\Mime::LINEEND);
         } else {
             $value = Mime\Mime::encodeBase64Header($value, $this->getCharset(), Mime\Mime::LINELENGTH, Mime\Mime::LINEEND);
         }
     }
     return $value;
 }
Ejemplo n.º 2
0
 /**
  * @group ZF-1688
  * @dataProvider dataTestEncodeMailHeaderBase64
  */
 public function testEncodeMailHeaderBase64($str, $charset, $result)
 {
     $this->assertEquals($result, Mime\Mime::encodeBase64Header($str, $charset));
 }