Skip to content

Commit

Permalink
[+]: some fixes ... v2
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed Dec 23, 2017
1 parent 261ae00 commit 0d8d0a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/classes/Swift/Signers/SMimeSigner.php
Expand Up @@ -452,7 +452,7 @@ protected function wrapMimeMessage(Swift_Message $message): \Swift_MimePart
protected function parseSSLOutput(Swift_InputByteStream $inputStream, Swift_Message $message)
{
$messageStream = new Swift_ByteStream_TemporaryFileByteStream();
$this->copyFromOpenSSLOutput($messageStream, $inputStream);
$this->copyFromOpenSSLOutput($inputStream, $messageStream);

$this->streamToMime($messageStream, $message);
}
Expand Down Expand Up @@ -541,12 +541,16 @@ protected function parseStream(Swift_OutputByteStream $emailStream): array
// Transform header lines into an associative array
foreach ($headerLines as $headerLine) {
// Handle headers that span multiple lines
if (false === strpos($headerLine, ':')) {
if ($currentHeaderName && false === strpos($headerLine, ':')) {
$headers[$currentHeaderName] .= ' ' . trim($headerLine);
continue;
}

$header = \explode(':', $headerLine, 2);
if ($header[0] === '') {
continue;
}

$currentHeaderName = Swift::strtolowerWithStaticCache($header[0]);
$headers[$currentHeaderName] = trim($header[1]);
}
Expand Down

0 comments on commit 0d8d0a7

Please sign in to comment.