Skip to content

Commit

Permalink
Mail\MimePart::encodeHeader() fixed counting of offset
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 25, 2014
1 parent bdb0446 commit 9745bcc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Nette/Mail/MimePart.php
Expand Up @@ -318,14 +318,15 @@ private static function encodeHeader($s, & $offset = 0, $force = FALSE)
return $o . $s;
}

$o .= str_replace("\n ", "\n\t", substr(iconv_mime_encode(str_repeat(' ', $offset), $s, array(
$s = iconv_mime_encode(str_repeat(' ', $old = $offset), $s, array(
'scheme' => 'B', // Q is broken
'input-charset' => 'UTF-8',
'output-charset' => 'UTF-8',
)), $offset + 2));
));

$offset = strlen($o) - strrpos($o, "\n");
return $o;
$offset = strlen($s) - strrpos($s, "\n");
$s = str_replace("\n ", "\n\t", substr($s, $old + 2)); // adds ': '
return $o . $s;
}

}

0 comments on commit 9745bcc

Please sign in to comment.