Bug #76958 [Csd]: Broken UTF7-IMAP conversion
| From: | nikic@php.net | Date: | Tue, 02 Oct 2018 14:17:02 +0000 |
| Subject: | Bug #76958 [Csd]: Broken UTF7-IMAP conversion | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217357@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76958&edit=1
ID: 76958
Updated by: nikic@php.net
Reported by: alec@php.net
Summary: Broken UTF7-IMAP conversion
Status: Closed
Type: Bug
Package: mbstring related
Operating System: Linux
PHP Version: 7.3.0RC2
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Some additional hardening implemented in https://github.com/php/php-src/commit/9cfd8f43c2a6386bcf1567a5c0de47dcb182b109,
to make sure that such issues result in an error, rather than mbstring doing god knows what.
Previous Comments:
------------------------------------------------------------------------
[2018-10-02 14:15:33] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=26f82a77061b7389c4507a2277643139339b430b
Log: Fixed bug #76958
------------------------------------------------------------------------
[2018-10-02 12:56:45] nikic@php.net
Looks like I missed this encoding when moving convert_vtbl pointers into mbfl_encoding.
------------------------------------------------------------------------
[2018-10-02 09:14:39] cmb@php.net
Confirmed: <https://3v4l.org/4WIAn>.
------------------------------------------------------------------------
[2018-10-02 06:49:15] alec@php.net
Sorry, I cut one character from the actual result. It looks like this:
&BCAEMARBBEEESwQ7BDoEOA-
0AAK;:8
------------------------------------------------------------------------
[2018-10-02 06:38:09] alec@php.net
Description:
------------
I'm testing PHP 7.3.0RC2 (cli) (built: Oct 1 2018 11:46:48) ( NTS ) Ondrej's PPA on
Ubuntu 18.04. It looks like conversion to/from UTF7-IMAP encoding is broken. See simple test script.
It works as expected on PHP <= 7.2.
Test script:
---------------
$str = '&BCAEMARBBEEESwQ7BDoEOA-';
echo mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP') . "\n";
$str = 'РаÑÑÑлки';
echo mb_convert_encoding($str, 'UTF7-IMAP', 'UTF-8') . "\n";
Expected result:
----------------
РаÑÑÑлки
&BCAEMARBBEEESwQ7BDoEOA-
Actual result:
--------------
BCAEMARBBEEESwQ7BDoEOA-
0AAK;:8
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76958&edit=1