com php-src: Fixed bug #76958: NEWS ext/mbstring/libmbfl/filter s/mbfilter_utf7imap.c ext/mbstring/tests/bug769 58.phpt
| From: | Nikita Popov | Date: | Tue, 02 Oct 2018 14:13:51 +0000 |
| Subject: | com php-src: Fixed bug #76958: NEWS ext/mbstring/libmbfl/filter s/mbfilter_utf7imap.c ext/mbstring/tests/bug769 58.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103301@lists.php.net to get a copy of this message | ||
Commit: 26f82a77061b7389c4507a2277643139339b430b
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 2 Oct 2018 16:13:51 +0200
Parents: 9cfd8f43c2a6386bcf1567a5c0de47dcb182b109
Branches: PHP-7.3 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=26f82a77061b7389c4507a2277643139339b430b
Log:
Fixed bug #76958
Bugs:
https://bugs.php.net/76958
Changed paths:
M NEWS
M ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
A ext/mbstring/tests/bug76958.phpt
Diff:
diff --git a/NEWS b/NEWS
index 906b6a6..694e879 100644
--- a/NEWS
+++ b/NEWS
@@ -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:
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
index 72c772b..d95c5db 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7imap.c
@@ -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 = {
diff --git a/ext/mbstring/tests/bug76958.phpt b/ext/mbstring/tests/bug76958.phpt
new file mode 100644
index 0000000..a7d6112
--- /dev/null
+++ b/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-