FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » maillists: "Subject" & headers handling
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
maillists: "Subject" & headers handling [message #19267] Mon, 05 July 2004 21:33 Go to previous message
Klopp   Russian Federation
Messages: 1
Registered: July 2004
Karma:
Junior Member
Possible error while headers handling. Example, original "Subject" field is:

=?UTF-8?B?0J7RgtCy0LXRgg==?= Re: =?UTF-8?B?0JAg0YLQsNC6PyDQvtGC?=


After posting, topic view:

ответ Re: =?UTF-8?B?0JAg0YLQsNC6PyDQvtGC?=


P.S. Patch for valid body & headers encoding:

include/scripts_common.inc:

function decode_string($str, $encoding, $charset='')
{
    $s = '';
    switch ($encoding) 
    {
	case 'quoted-printable':
		// Remove soft line breaks & decode
	    $s = quoted_printable_decode( preg_replace("!=\r?\n!", '', $str) );
	    break;
	case 'base64':
	    $s = base64_decode( $str );
	    break;
	default:
	    $s = $str;
	    break;
    }
    if( $charset )
    {
	$s = recode( "$charset..$FORUM_CHARSET", $s );
    }
    return $s;    
}

function decode_header_value($val)
{
// ..skipped..
	    if ($ec_type == 'q') 
	    {
		$newval .= decode_string(str_replace('_', ' ', $m[5][$i]), 'quoted-printable', $m[3][$i]);
	    } 
	    else if ($ec_type == 'b') 
	    {
		$newval .= decode_string($m[5][$i], 'base64', $m[3][$i]);
	    }
// ..skipped..
}

scripts/maillist.php:

	function decode_message_body()
	{
	    $this -> body = decode_string( $this -> body, 
                            headers['content-transfer-encoding'], 
                               $this->headers['__other_hdr__']['content-type']['charset']);
	}
[Message index]
 
Read Message
Read Message
Previous Topic: Problems with mailing lists (solved)
Next Topic: nntp and subject length
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 09:23:40 GMT 2024

Total time taken to generate the page: 0.03736 seconds