diff options
author | David Flatz | 2016-02-15 19:10:40 +0100 |
---|---|---|
committer | David Flatz | 2016-02-15 19:10:40 +0100 |
commit | 2a6868c85156c17c0cd7ec0c91921446b3097db5 (patch) | |
tree | 674b418bc946509e0714f961768aa2a2fc3b4e5b /it_mail.class | |
parent | 5edca4f4d3fd9894855bf5d271a2ee00cefebdab (diff) | |
download | itools-2a6868c85156c17c0cd7ec0c91921446b3097db5.tar.gz itools-2a6868c85156c17c0cd7ec0c91921446b3097db5.tar.bz2 itools-2a6868c85156c17c0cd7ec0c91921446b3097db5.zip |
if encoding fails (because of broken utf8), use latin1 as input charset; even though its ugly it's still better than empty subjects
Diffstat (limited to 'it_mail.class')
-rw-r--r-- | it_mail.class | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/it_mail.class b/it_mail.class index 6c4398f..503da08 100644 --- a/it_mail.class +++ b/it_mail.class @@ -308,7 +308,9 @@ function header_escape($string) ? 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)), + : ($encoded = @iconv_mime_encode('', $string, array('scheme' => 'B', 'input-charset' => $this->charset, 'output-charset' => $this->charset))) !== false + ? $encoded + : iconv_mime_encode('', $string, array('scheme', 'B', 'input-charset' => 'ISO-8859-1', 'output-charset' => $this->charset)), ' :' ) : $string; |