Skip to content

Commit

Permalink
Fixed bug #76958
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Oct 2, 2018
1 parent 9cfd8f4 commit 26f82a7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Expand Up @@ -9,6 +9,9 @@ PHP NEWS
. Fixed bug #72635 (Undefined class used by class constant in constexpr
generates fatal error). (Nikita)

- Mbstring:
. Fixed bug #76958 (Broken UTF7-IMAP conversion). (Nikita)

27 Sep 2018, PHP 7.3.0RC2

- CURL:
Expand Down
4 changes: 3 additions & 1 deletion ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
Expand Up @@ -40,7 +40,9 @@ const mbfl_encoding mbfl_encoding_utf7imap = {
NULL,
NULL,
NULL,
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE,
&vtbl_utf7imap_wchar,
&vtbl_wchar_utf7imap
};

const struct mbfl_convert_vtbl vtbl_utf7imap_wchar = {
Expand Down
14 changes: 14 additions & 0 deletions ext/mbstring/tests/bug76958.phpt
@@ -0,0 +1,14 @@
--TEST--
Bug #76958: Broken UTF7-IMAP conversion
--FILE--
<?php

$str = '&BCAEMARBBEEESwQ7BDoEOA-';
echo mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP') . "\n";
$str = 'Рассылки';
echo mb_convert_encoding($str, 'UTF7-IMAP', 'UTF-8') . "\n";

?>
--EXPECT--
Рассылки
&BCAEMARBBEEESwQ7BDoEOA-

0 comments on commit 26f82a7

Please sign in to comment.