Bug #55146 [Ver]: iconv_mime_decode_headers() skips some headers

From: Date: Sun, 12 Aug 2018 18:00:40 +0000
Subject: Bug #55146 [Ver]: iconv_mime_decode_headers() skips some headers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216737@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55146&edit=1 ID: 55146 Updated by: cmb@php.net Reported by: dmitry at spamexperts dot com Summary: iconv_mime_decode_headers() skips some headers Status: Verified Type: Bug Package: ICONV related Operating System: Debian Squeeze PHP Version: Irrelevant Block user comment: N Private report: N New Comment: <https://github.com/php/php-src/pull/3437> is supposed to resolve this issue. Previous Comments: ------------------------------------------------------------------------ [2018-08-12 16:42:08] cmb@php.net Ah, now I've got it! The result is greatly affected by the line endings. With proper CRLF there are two headers, but the first has a trailing CR. If the headers are separated by LF only, the result is as reported. Furthermore, if the header value consists of a single equal sign (=), ICONV_MIME_DECODE_STRICT is broken as well. ------------------------------------------------------------------------ [2017-06-14 19:03:04] php at spam dot lifeforms dot nl We stumbled upon the same bug, I think. There is definitely something interesting going on when a '=' character is used in a header, but only in ICONV_MIME_DECODE_CONTINUE_ON_ERROR. E-mails from Trello are parsed incorrectly in this case, for instance. As a testcase shows, the next header is being appended to the "DKIM-Signature" header containing the '=' characters: https://3v4l.org/nfLjB ------------------------------------------------------------------------ [2015-05-16 12:47:56] cmb@php.net I can't reproduce this issue, see <http://3v4l.org/QcCSR>. It might be related to the iconv library in use. ------------------------------------------------------------------------ [2011-07-16 04:56:52] dmitry at spamexperts dot com If you mean encoding of the X-Header-One header contents (H4sIAAAAAAAAA+NgFlsCAAA=) - that's just a random set of chars. ------------------------------------------------------------------------ [2011-07-16 04:53:55] dmitry at spamexperts dot com The whole application is using UTF-8 encoding, also if I add iconv_set_encoding('internal_encoding', 'UTF-8'); iconv_set_encoding('input_encoding', 'UTF-8'); iconv_set_encoding('output_encoding', 'UTF-8'); at the beginning of the test script the bug is still actual. Hope that helps, if not - feel free to ask me for any info you need. Thanks! ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=55146 -- Edit this bug report at https://bugs.php.net/bug.php?id=55146&edit=1

« previous php.bugs (#216737) next »