diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-12 15:03:47 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-08-25 14:30:07 +0200 |
commit | eb03290754105dbefeb5a3d75c20e504cd82715b (patch) | |
tree | 144ae2c0b337fec882cf75d04080fd0895e2f641 /ext/sqlite/php_sqlite.h | |
parent | 692e5d5c88a939a7c3ce3de61c5fd39effe7c7ae (diff) | |
download | php-git-eb03290754105dbefeb5a3d75c20e504cd82715b.tar.gz |
Fix #53891: iconv_mime_encode() fails to Q-encode UTF-8 string
The minimum length of an encoded-word is actually the pure encoding
overhead plus the length of the `output-charset` plus the minimum unit
of encoded text, which is 4 for B-encoding and (for simplicity) 3 for
Q-encoding. We also cater to the possibility that we need further
encoded words, which would be split by the `line-break-chars` followed
by a space character. Obviously, the former `out_charset_len + 12` is
too simplistic and wrong in the given case (where the magic number
would be 13).
These simplifications are somewhat wasteful, but iconv_mime_encode()
with Q-encoding is wasteful anyway (see bug 66828[1]), and the proper
solution to convert the whole input to the desired output charset
upfront, and applying the encoding afterwards appears too much a change
for the stable releases.
[1] <https://bugs.php.net/66828>
Diffstat (limited to 'ext/sqlite/php_sqlite.h')
0 files changed, 0 insertions, 0 deletions