mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-11 03:51:25 +01:00
swiftmailer
This commit is contained in:
@@ -20,14 +20,14 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $_name;
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* True if canonical transformations should be done.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $_canonical;
|
||||
private $canonical;
|
||||
|
||||
/**
|
||||
* Creates a new PlainContentEncoder with $name (probably 7bit or 8bit).
|
||||
@@ -37,8 +37,8 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*/
|
||||
public function __construct($name, $canonical = false)
|
||||
{
|
||||
$this->_name = $name;
|
||||
$this->_canonical = $canonical;
|
||||
$this->name = $name;
|
||||
$this->canonical = $canonical;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,11 +52,11 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*/
|
||||
public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
|
||||
{
|
||||
if ($this->_canonical) {
|
||||
$string = $this->_canonicalize($string);
|
||||
if ($this->canonical) {
|
||||
$string = $this->canonicalize($string);
|
||||
}
|
||||
|
||||
return $this->_safeWordWrap($string, $maxLineLength, "\r\n");
|
||||
return $this->safeWordwrap($string, $maxLineLength, "\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,10 +72,10 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
$leftOver = '';
|
||||
while (false !== $bytes = $os->read(8192)) {
|
||||
$toencode = $leftOver.$bytes;
|
||||
if ($this->_canonical) {
|
||||
$toencode = $this->_canonicalize($toencode);
|
||||
if ($this->canonical) {
|
||||
$toencode = $this->canonicalize($toencode);
|
||||
}
|
||||
$wrapped = $this->_safeWordWrap($toencode, $maxLineLength, "\r\n");
|
||||
$wrapped = $this->safeWordwrap($toencode, $maxLineLength, "\r\n");
|
||||
$lastLinePos = strrpos($wrapped, "\r\n");
|
||||
$leftOver = substr($wrapped, $lastLinePos);
|
||||
$wrapped = substr($wrapped, 0, $lastLinePos);
|
||||
@@ -94,7 +94,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->_name;
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _safeWordwrap($string, $length = 75, $le = "\r\n")
|
||||
private function safeWordwrap($string, $length = 75, $le = "\r\n")
|
||||
{
|
||||
if (0 >= $length) {
|
||||
return $string;
|
||||
@@ -151,7 +151,7 @@ class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mime_Conten
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function _canonicalize($string)
|
||||
private function canonicalize($string)
|
||||
{
|
||||
return str_replace(
|
||||
array("\r\n", "\r", "\n"),
|
||||
|
||||
Reference in New Issue
Block a user