summaryrefslogtreecommitdiff
path: root/it_mail.class
diff options
context:
space:
mode:
authorDavid Flatz2016-02-08 19:09:52 +0100
committerDavid Flatz2016-02-08 19:09:52 +0100
commit5edca4f4d3fd9894855bf5d271a2ee00cefebdab (patch)
tree97d2a3e745624b2be5642123fca14c6d3228685d /it_mail.class
parent66a0c9f49176ec3309b94ea232fbbd92735454ae (diff)
downloaditools-5edca4f4d3fd9894855bf5d271a2ee00cefebdab.tar.gz
itools-5edca4f4d3fd9894855bf5d271a2ee00cefebdab.tar.bz2
itools-5edca4f4d3fd9894855bf5d271a2ee00cefebdab.zip
encode header with base64 when quoted-printable fails because of php bug #53891
Diffstat (limited to 'it_mail.class')
-rw-r--r--it_mail.class7
1 files changed, 6 insertions, 1 deletions
diff --git a/it_mail.class b/it_mail.class
index aa242c5..6c4398f 100644
--- a/it_mail.class
+++ b/it_mail.class
@@ -305,7 +305,12 @@ function send($p = array())
function header_escape($string)
{
return preg_match('/[\x00-\x1f\x7f-\xff]/', $string)
- ? ltrim(iconv_mime_encode('', $string, array('scheme' => 'Q', 'input-charset' => $this->charset, 'output-charset' => $this->charset)), ' :')
+ ? ltrim(
+ ($encoded = @iconv_mime_encode('', $string, array('scheme' => 'Q', 'input-charset' => $this->charset, 'output-charset' => $this->charset))) !== false
+ ? $encoded
+ : iconv_mime_encode('', $string, array('scheme' => 'B', 'input-charset' => $this->charset, 'output-charset' => $this->charset)),
+ ' :'
+ )
: $string;
}