Merge branch 'dev' into 'dev'
email_header_encode() producing output that is not spec compliant See merge request hubzilla/core!1555
This commit is contained in:
commit
e92514ee63
@ -874,13 +874,16 @@ function xml2array($contents, $namespaces = true, $get_attributes=1, $priority =
|
||||
}
|
||||
|
||||
|
||||
function email_header_encode($in_str, $charset = 'UTF-8') {
|
||||
function email_header_encode($in_str, $charset = 'UTF-8', $header = 'Subject') {
|
||||
|
||||
|
||||
$out_str = $in_str;
|
||||
$need_to_convert = false;
|
||||
|
||||
for($x = 0; $x < strlen($in_str); $x ++) {
|
||||
if((ord($in_str[$x]) == 0) || ((ord($in_str[$x]) > 128))) {
|
||||
$need_to_convert = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -896,7 +899,7 @@ function email_header_encode($in_str, $charset = 'UTF-8') {
|
||||
|
||||
// determine length of encoded text within chunks
|
||||
// and ensure length is even
|
||||
$length = 75 - strlen($start) - strlen($end);
|
||||
$length = 75 - strlen($start) - strlen($end) - (strlen($header) + 2);
|
||||
|
||||
/*
|
||||
[EDIT BY danbrown AT php DOT net: The following
|
||||
|
Reference in New Issue
Block a user