Skip to content

Commit c58f63a

Browse files
committed
- Fixed #44098, imap_utf8() returns only capital letters
1 parent e37ba52 commit c58f63a

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

NEWS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ PHP NEWS
6969
- Fixed bug #47281 ($php_errormsg is limited in size of characters)
7070
(Oracle Corp.)
7171
- Fixed bug #44827 (define() allows :: in constant names). (Ilia)
72-
72+
- Fixed bug #44098 (imap_utf8() returns only capital letters).
73+
(steffen at dislabs dot de, Pierre)
7374

7475
?? ??? 20??, PHP 5.3.2
7576
- Upgraded bundled sqlite to version 3.6.21. (Ilia)

ext/imap/config.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,23 +147,23 @@ if test "$PHP_IMAP" != "no"; then
147147

148148
old_CFLAGS=$CFLAGS
149149
CFLAGS="-I$IMAP_INC_DIR"
150-
AC_CACHE_CHECK(for U8T_CANONICAL, ac_cv_u8t_canonical,
150+
AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_canonical,
151151
AC_TRY_COMPILE([
152152
#include <c-client.h>
153153
],[
154154
int i = U8T_CANONICAL;
155155
],[
156-
ac_cv_u8t_canonical=yes
156+
ac_cv_u8t_decompose=yes
157157
],[
158-
ac_cv_u8t_canonical=no
158+
ac_cv_u8t_decompose=no
159159
])
160160
)
161161
CFLAGS=$old_CFLAGS
162162

163-
if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then
163+
if test "$ac_cv_u8t_decompose" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then
164164
AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.])
165165
fi
166-
if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then
166+
if test "$ac_cv_u8t_decompose" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then
167167
AC_MSG_ERROR([utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information.])
168168
fi
169169

ext/imap/config.w32

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ if (PHP_IMAP == "yes") {
2121
AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Have utf8_mime2text', true);
2222
AC_DEFINE('HAVE_RFC822_OUTPUT_ADDRESS_LIST', 1, 'Have rfc822_output_address_list', true);
2323
AC_DEFINE('HAVE_IMAP_MUTF7', 1, 'Have modified utf7 support', true);
24+
AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Whether utf8_mime2text() has new signature');
2425
} else {
2526
WARNING("imap not enabled; libraries and headers not found");
2627
}

ext/imap/php_imap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2664,7 +2664,7 @@ PHP_FUNCTION(imap_utf8)
26642664
#ifndef HAVE_NEW_MIME2TEXT
26652665
utf8_mime2text(&src, &dest);
26662666
#else
2667-
utf8_mime2text(&src, &dest, U8T_CANONICAL);
2667+
utf8_mime2text(&src, &dest, U8T_DECOMPOSE);
26682668
#endif
26692669
RETVAL_STRINGL(dest.data, dest.size, 1);
26702670
if (dest.data) {

ext/imap/tests/bug44098.phpt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Bug #44098 (imap_utf8() returns only capital letters)
3+
--SKIPIF--
4+
<?php
5+
if (!extension_loaded("imap")) {
6+
die("skip imap extension not available");
7+
}
8+
?>
9+
--FILE--
10+
<?php
11+
$exp = 'Luzon®14 dot CoM';
12+
$res = imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');
13+
if ($res != $exp) {
14+
echo "failed: got <$res>, expected <exp>\n";
15+
} else {
16+
echo "ok";
17+
}
18+
?>
19+
--EXPECT--
20+
ok

0 commit comments

Comments
 (0)