Skip to content

Commit 26f82a7

Browse files
committed
Fixed bug #76958
1 parent 9cfd8f4 commit 26f82a7

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ PHP NEWS
99
. Fixed bug #72635 (Undefined class used by class constant in constexpr
1010
generates fatal error). (Nikita)
1111

12+
- Mbstring:
13+
. Fixed bug #76958 (Broken UTF7-IMAP conversion). (Nikita)
14+
1215
27 Sep 2018, PHP 7.3.0RC2
1316

1417
- CURL:

ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ const mbfl_encoding mbfl_encoding_utf7imap = {
4040
NULL,
4141
NULL,
4242
NULL,
43-
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE
43+
MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE,
44+
&vtbl_utf7imap_wchar,
45+
&vtbl_wchar_utf7imap
4446
};
4547

4648
const struct mbfl_convert_vtbl vtbl_utf7imap_wchar = {

ext/mbstring/tests/bug76958.phpt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--TEST--
2+
Bug #76958: Broken UTF7-IMAP conversion
3+
--FILE--
4+
<?php
5+
6+
$str = '&BCAEMARBBEEESwQ7BDoEOA-';
7+
echo mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP') . "\n";
8+
$str = 'Рассылки';
9+
echo mb_convert_encoding($str, 'UTF7-IMAP', 'UTF-8') . "\n";
10+
11+
?>
12+
--EXPECT--
13+
Рассылки
14+
&BCAEMARBBEEESwQ7BDoEOA-

0 commit comments

Comments
 (0)