mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01: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
|
||||
*/
|
||||
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');
|
||||
$lines = preg_split('/(?:\r\n|\r|\n)/', $input);
|
||||
$eol = "\r\n";
|
||||
@ -1454,6 +1472,7 @@ class PHPMailer {
|
||||
} // end of while
|
||||
return trim($output);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode string to q encoding.
|
||||
|
Loading…
Reference in New Issue
Block a user