mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 21:01:30 +02:00
Since having problems with the new phpmailers EncodeQP function and its Char and Line/WordWrap Handling, I reintroduce the functionality of the old
class.
This commit is contained in:
parent
2e28640d9e
commit
9dfa6f6d4c
@ -1415,6 +1415,24 @@ class PHPMailer {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
|
public function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
|
||||||
|
//old behavior
|
||||||
|
if ($line_max==76 && $space_conv === false) {
|
||||||
|
$encoded = $this->FixEOL($input);
|
||||||
|
if (substr($encoded, -(strlen($this->LE))) != $this->LE)
|
||||||
|
$encoded .= $this->LE;
|
||||||
|
|
||||||
|
// Replace every high ascii, control and = characters
|
||||||
|
$encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e',
|
||||||
|
"'='.sprintf('%02X', ord('\\1'))", $encoded);
|
||||||
|
// Replace every spaces and tabs when it's the last character on a line
|
||||||
|
$encoded = preg_replace("/([\011\040])".$this->LE."/e",
|
||||||
|
"'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded);
|
||||||
|
|
||||||
|
// Maximum line length of 76 characters before CRLF (74 + space + '=')
|
||||||
|
$encoded = $this->WrapText($encoded, $line_max-2, true);
|
||||||
|
|
||||||
|
return $encoded;
|
||||||
|
} else {
|
||||||
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
|
$hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
|
||||||
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
|
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
|
||||||
$eol = "\r\n";
|
$eol = "\r\n";
|
||||||
@ -1454,6 +1472,7 @@ class PHPMailer {
|
|||||||
} // end of while
|
} // end of while
|
||||||
return trim($output);
|
return trim($output);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode string to q encoding.
|
* Encode string to q encoding.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user