/**
  * Use internal moodles own textlib to encode mimeheaders.
  * Fall back to phpmailers inbuilt functions if not 
  */
 public function EncodeHeader($str, $position = 'text')
 {
     $encoded = textlib::encode_mimeheader($str, $this->CharSet);
     if ($encoded !== false) {
         $encoded = str_replace("\n", $this->LE, $encoded);
         if ($position == 'phrase') {
             return "\"{$encoded}\"";
         }
         return $encoded;
     }
     return parent::EncodeHeader($str, $position);
 }
 function EncodeHeader($str, $position = 'text')
 {
     global $modx;
     if ($this->encode_header_method == 'mb_encode_mimeheader') {
         return mb_encode_mimeheader($str, $this->CharSet, 'B', "\n");
     }
     switch ($this->charset) {
         case 'japanese-utf8':
         case 'japanese-euc':
             return $str;
             break;
         default:
             return parent::EncodeHeader($str, $position);
     }
 }
Example #3
0
 public function EncodeHeader($str, $position = 'text')
 {
     if ($position == 'text') {
         return $this->convertLocal($str, true);
     } else {
         return parent::EncodeHeader($str, $position);
     }
 }
 function EncodeHeader($str, $position = 'text')
 {
     global $modx, $sanitize_seed;
     if (strpos($str, $sanitize_seed) !== false) {
         $str = str_replace($sanitize_seed, '', $str);
     }
     if ($this->encode_header_method == 'mb_encode_mimeheader') {
         return mb_encode_mimeheader($str, $this->CharSet, 'B', "\n");
     } else {
         return parent::EncodeHeader($str, $position);
     }
 }
 /**
  * overloads PHPMailer's EncodeHeader method to correctly use mb_encode_header() if/when available
  * @param string header
  * @return string encoded
  */
 function EncodeHeader($string, $position = 'text')
 {
     global $locale;
     if (function_exists('mb_encode_header')) {
         return mb_encode_mimeheader($string, $locale->getPrecedentPreference('default_export_charset'));
     } else {
         return parent::EncodeHeader($string, $position);
     }
 }