diff --git a/src/Symfony/Component/Mime/Crypto/SMime.php b/src/Symfony/Component/Mime/Crypto/SMime.php index c6317a6bb11f2..ad88c1987ac96 100644 --- a/src/Symfony/Component/Mime/Crypto/SMime.php +++ b/src/Symfony/Component/Mime/Crypto/SMime.php @@ -65,7 +65,7 @@ protected function convertMessageToSMimePart($stream, string $type, string $subt 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))); } } diff --git a/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php b/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php index cad87bfab7367..92df05e391c7e 100644 --- a/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php +++ b/src/Symfony/Component/Mime/Tests/Crypto/SMimeEncryptorTest.php @@ -87,7 +87,11 @@ public function testEncryptMessageWithMultipleCerts() 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(); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy