KevinTheJedi
Kevin,
This is being caused by the changes made from this thread I used backup files I created before I altered the code and the issue was resolved.
Here is the code in problem files
class.Format.php
` static function mimedecode($text, $encoding='UTF-8') {
// Handle poorly or completely un-encoded header values (
if (function_exists('mb_detect_encoding'))
if (($src_enc = mb_detect_encoding($text))
&& (strcasecmp($src_enc, 'ASCII') !== 0))
return Charset::transcode($text, $src_enc, $encoding);
if(function_exists('imap_mime_header_decode')
&& ($parts = imap_mime_header_decode($text))) {
$str ='';
foreach ($parts as $part)
$str.= Charset::transcode($part->text, $part->charset, $encoding);
$text = $str;
} elseif($text[0] == '=' && function_exists('iconv_mime_decode')) {
$text = iconv_mime_decode($text, 0, $encoding);
} elseif(!strcasecmp($encoding, 'utf-8')
&& function_exists('imap_utf8')) {
$text = imap_utf8($text);
}
return $text;
}
/**
* Formats header addresses for better parsing. Decodes encoded
* addresses and removes any quotes.
*/
static function fixupAddressHeader($address) {
// Decode encoded addresses
if (str_contains($address, '=?'))
$address = self::mimedecode($address, $charset);
// Strip any quotes
return str_replace(["'", '"'], '', $address);
}
/**
* Decodes filenames given in the content-disposition header according
* to RFC5987, such as filename*=utf-8''filename.png. Note that the
* language sub-component is defined in RFC5646, and that the filename
* is URL encoded (in the charset specified)
*/
static function decodeRfc5987($filename) {
$match = array();
if (preg_match("/([\w!#$%&+^_`{}~-]+)'([\w-]*)'(.*)$/",
$filename, $match))
// XXX: Currently we don't care about the language component.`
class.mailparse.php
// Delivered-To may appear more than once in the email headers
if (is_array($address))
$address = implode(', ', $address);
$rfc822 = new Mail_RFC822();
$parsed = $rfc822->parseAddressList(Format::fixupAddressHeader($address), null, null,false);
if (PEAR::isError($parsed))
return array();
Is there something in the code that's causing this?