mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 19:41:26 +01:00
FIX: Update swiftmailer librairies
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
/**
|
||||
* Handles binary/7/8-bit Transfer Encoding in Swift Mailer.
|
||||
*
|
||||
* When sending 8-bit content over SMTP, you should use
|
||||
* Swift_Transport_Esmtp_EightBitMimeHandler to enable the 8BITMIME SMTP
|
||||
* extension.
|
||||
*
|
||||
* @author Chris Corbyn
|
||||
*/
|
||||
class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_ContentEncoder
|
||||
@@ -33,7 +37,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
* Creates a new PlainContentEncoder with $name (probably 7bit or 8bit).
|
||||
*
|
||||
* @param string $name
|
||||
* @param bool $canonical If canonicalization transformation should be done.
|
||||
* @param bool $canonical if canonicalization transformation should be done
|
||||
*/
|
||||
public function __construct($name, $canonical = false)
|
||||
{
|
||||
@@ -62,10 +66,8 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
/**
|
||||
* Encode stream $in to stream $out.
|
||||
*
|
||||
* @param Swift_OutputByteStream $os
|
||||
* @param Swift_InputByteStream $is
|
||||
* @param int $firstLineOffset ignored
|
||||
* @param int $maxLineLength optional, 0 means no wrapping will occur
|
||||
* @param int $firstLineOffset ignored
|
||||
* @param int $maxLineLength optional, 0 means no wrapping will occur
|
||||
*/
|
||||
public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)
|
||||
{
|
||||
@@ -82,7 +84,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
|
||||
$is->write($wrapped);
|
||||
}
|
||||
if (strlen($leftOver)) {
|
||||
if (\strlen($leftOver)) {
|
||||
$is->write($leftOver);
|
||||
}
|
||||
}
|
||||
@@ -121,7 +123,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
|
||||
$originalLines = explode($le, $string);
|
||||
|
||||
$lines = array();
|
||||
$lines = [];
|
||||
$lineCount = 0;
|
||||
|
||||
foreach ($originalLines as $originalLine) {
|
||||
@@ -132,8 +134,8 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
$chunks = preg_split('/(?<=\s)/', $originalLine);
|
||||
|
||||
foreach ($chunks as $chunk) {
|
||||
if (0 != strlen($currentLine)
|
||||
&& strlen($currentLine.$chunk) > $length) {
|
||||
if (0 != \strlen($currentLine)
|
||||
&& \strlen($currentLine.$chunk) > $length) {
|
||||
$lines[] = '';
|
||||
$currentLine = &$lines[$lineCount++];
|
||||
}
|
||||
@@ -154,8 +156,8 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
private function canonicalize($string)
|
||||
{
|
||||
return str_replace(
|
||||
array("\r\n", "\r", "\n"),
|
||||
array("\n", "\n", "\r\n"),
|
||||
["\r\n", "\r", "\n"],
|
||||
["\n", "\n", "\r\n"],
|
||||
$string
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user