Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2
Browse files Browse the repository at this point in the history
  • Loading branch information
tr committed Aug 13, 2012
3 parents 9f06d58 + d3fd832 + 55daa98 commit 49269e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/Mime.php
Expand Up @@ -189,30 +189,30 @@ public static function encodeQuotedPrintableHeader($str, $charset,

// Split encoded text into separate lines
$tmp = "";
while(strlen($str) > 0) {
while (strlen($str) > 0) {
$currentLine = max(count($lines)-1, 0);
$token = self::getNextQuotedPrintableToken($str);
$str = substr($str, strlen($token));

$tmp .= $token;
if($token == '=20') {
if ($token == '=20') {
// only if we have a single char token or space, we can append the
// tempstring it to the current line or start a new line if necessary.
if(strlen($lines[$currentLine].$tmp) > $lineLength) {
if (strlen($lines[$currentLine].$tmp) > $lineLength) {
$lines[$currentLine+1] = $tmp;
} else {
$lines[$currentLine] .= $tmp;
}
$tmp = "";
}
// don't forget to append the rest to the last line
if(strlen($str) == 0) {
if (strlen($str) == 0) {
$lines[$currentLine] .= $tmp;
}
}

// assemble the lines together by pre- and appending delimiters, charset, encoding.
for($i = 0; $i < count($lines); $i++) {
for ($i = 0; $i < count($lines); $i++) {
$lines[$i] = " ".$prefix.$lines[$i]."?=";
}
$str = trim(implode($lineEnd, $lines));
Expand All @@ -227,7 +227,7 @@ public static function encodeQuotedPrintableHeader($str, $charset,
*/
private static function getNextQuotedPrintableToken($str)
{
if(substr($str, 0, 1) == "=") {
if (substr($str, 0, 1) == "=") {
$token = substr($str, 0, 3);
} else {
$token = substr($str, 0, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/Part.php
Expand Up @@ -187,7 +187,7 @@ public function getHeadersArray($EOL = Mime::LINEEND)
$headers[] = array('Content-Location', $this->location);
}

if ($this->language){
if ($this->language) {
$headers[] = array('Content-Language', $this->language);
}

Expand Down

0 comments on commit 49269e7

Please sign in to comment.