Fix last header line size calculation

The "From: " prefix size was not taken into accounts when
calculating how many characters were on the last header line
produced by mb_encode_mimeheader.

This is used to check if the e-mail address should be
placed on a separate line.
This commit is contained in:
Jean-Philippe Guérard 2012-01-18 00:51:23 +01:00
parent 87c0dd21f6
commit caf84064df
1 changed files with 2 additions and 2 deletions

View File

@ -172,10 +172,10 @@ function sendEmail( $to, $subject, $body, $headers, $param)
$subject = mb_encode_mimeheader( html_entity_decode( $subject, ENT_QUOTES, 'UTF-8' ), "UTF-8", "B", "\n", 9 ) ;
$encoded_app = mb_encode_mimeheader( NOMAPPLICATION, "UTF-8", "B", "\n", 6 ) ;
$size_encoded_app = strlen( $encoded_app ) % 75 ;
$size_encoded_app = ( 6 + strlen( $encoded_app ) ) % 75 ;
$size_admin_email = strlen( ADRESSEMAILADMIN ) ;
if ( $size_encoded_app + $size_admin_email + 9 > 74 ) {
if ( ( $size_encoded_app + $size_admin_email + 9 ) > 74 ) {
$folding = "\n" ;
} else {
$folding = "" ;