Permalink
Browse files

Merge pull request #2985 from maximilian-walter/develop

Zend\Mime\Part::getEncodedStream() did not use correct EOL (Issue #2918)
  • Loading branch information...
2 parents fb88bd5 + c3bb7fd commit 38e6d95a585769681c839b1bf72fd4dbac786c63 @Maks3w Maks3w committed Nov 16, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 library/Zend/Mime/Part.php
@@ -70,10 +70,11 @@ public function isStream()
* if this was created with a stream, return a filtered stream for
* reading the content. very useful for large file attachments.
*
+ * @param string $EOL
* @return stream
* @throws Exception\RuntimeException if not a stream or unable to append filter
*/
- public function getEncodedStream()
+ public function getEncodedStream($EOL = Mime::LINEEND)
{
if (!$this->isStream) {
throw new Exception\RuntimeException('Attempt to get a stream from a string part');
@@ -88,7 +89,7 @@ public function getEncodedStream()
STREAM_FILTER_READ,
array(
'line-length' => 76,
- 'line-break-chars' => Mime::LINEEND
+ 'line-break-chars' => $EOL
)
);
if (!is_resource($filter)) {
@@ -102,7 +103,7 @@ public function getEncodedStream()
STREAM_FILTER_READ,
array(
'line-length' => 76,
- 'line-break-chars' => Mime::LINEEND
+ 'line-break-chars' => $EOL
)
);
if (!is_resource($filter)) {
@@ -123,7 +124,7 @@ public function getEncodedStream()
public function getContent($EOL = Mime::LINEEND)
{
if ($this->isStream) {
- return stream_get_contents($this->getEncodedStream());
+ return stream_get_contents($this->getEncodedStream($EOL));
}
return Mime::encode($this->content, $this->encoding, $EOL);
}

0 comments on commit 38e6d95

Please sign in to comment.