@@ 404-415 (lines=12) @@ | ||
401 | $encoded_value[$key] = Swift_Message_Encoder::instance()->header7BitEncode( |
|
402 | $row, 72, ($key > 0 ? 0 : (75-(strlen($name)+5))), $this->LE); |
|
403 | } |
|
404 | elseif ($this->encoding == "Q") //QP encode required |
|
405 | { |
|
406 | $spec = "=?" . $this->getCharset() . "?Q?"; //e.g. =?iso-8859-1?Q? |
|
407 | $end = "?="; |
|
408 | //Calculate the length of, for example: "From: =?iso-8859-1?Q??=" |
|
409 | $used_length = strlen($name) + 2 + strlen($spec) + 2; |
|
410 | ||
411 | //Encode to QP, excluding the specification for now but keeping the lines short enough to be compliant |
|
412 | $encoded_value[$key] = str_replace(" ", "_", Swift_Message_Encoder::instance()->QPEncode( |
|
413 | $row, (75-(strlen($spec)+6)), ($key > 0 ? 0 : (75-$used_length)), true, $this->LE)); |
|
414 | ||
415 | } |
|
416 | elseif ($this->encoding == "B") //Need to Base64 encode |
|
417 | { |
|
418 | //See the comments in the elseif() above since the logic is the same (refactor?) |
|
@@ 416-424 (lines=9) @@ | ||
413 | $row, (75-(strlen($spec)+6)), ($key > 0 ? 0 : (75-$used_length)), true, $this->LE)); |
|
414 | ||
415 | } |
|
416 | elseif ($this->encoding == "B") //Need to Base64 encode |
|
417 | { |
|
418 | //See the comments in the elseif() above since the logic is the same (refactor?) |
|
419 | $spec = "=?" . $this->getCharset() . "?B?"; |
|
420 | $end = "?="; |
|
421 | $used_length = strlen($name) + 2 + strlen($spec) + 2; |
|
422 | $encoded_value[$key] = Swift_Message_Encoder::instance()->base64Encode( |
|
423 | $row, (75-(strlen($spec)+5)), ($key > 0 ? 0 : (76-($used_length+3))), true, $this->LE); |
|
424 | } |
|
425 | ||
426 | if (false !== $p = strpos($encoded_value[$key], $this->LE)) |
|
427 | { |