aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-03-15 19:12:51 +0100
committerMario <mario@mariovavti.com>2019-03-15 19:12:51 +0100
commite92514ee632aea74aad812432f37259c3fec5fc1 (patch)
tree2063ab5230529cf7b4ab37f2c34f3e205f9147ac /include
parenta22406c9f83b61368dc108dbab1e9ce254ebedfa (diff)
parent8ebc517b4174c400009300e1c13f2f95ba78353b (diff)
downloadvolse-hubzilla-e92514ee632aea74aad812432f37259c3fec5fc1.tar.gz
volse-hubzilla-e92514ee632aea74aad812432f37259c3fec5fc1.tar.bz2
volse-hubzilla-e92514ee632aea74aad812432f37259c3fec5fc1.zip
Merge branch 'dev' into 'dev'
email_header_encode() producing output that is not spec compliant See merge request hubzilla/core!1555
Diffstat (limited to 'include')
-rw-r--r--include/network.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/network.php b/include/network.php
index 12f2ad4e9..3e8134a32 100644
--- a/include/network.php
+++ b/include/network.php
@@ -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