[Mime] Ensure proper line-ending for SMIME
This commit is contained in:
parent
4f8f3747d3
commit
5e3ccc2814
@ -65,7 +65,7 @@ abstract class SMime
|
||||
protected function getStreamIterator($stream): iterable
|
||||
{
|
||||
while (!feof($stream)) {
|
||||
yield fread($stream, 16372);
|
||||
yield str_replace("\n", "\r\n", str_replace("\r\n", "\n", fread($stream, 16372)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,11 @@ class SMimeEncryptorTest extends SMimeTestCase
|
||||
private function assertMessageIsEncryptedProperly(Message $message, Message $originalMessage): void
|
||||
{
|
||||
$messageFile = $this->generateTmpFilename();
|
||||
file_put_contents($messageFile, $message->toString());
|
||||
file_put_contents($messageFile, $messageString = $message->toString());
|
||||
|
||||
// Ensure the proper line-ending is used for compatibility with the RFC
|
||||
$this->assertStringContainsString("\n\r", $messageString);
|
||||
$this->assertStringNotContainsString("\n\n", $messageString);
|
||||
|
||||
$outputFile = $this->generateTmpFilename();
|
||||
|
||||
|
Reference in New Issue
Block a user