diff options
| author | Pierre Joye <pajoye@php.net> | 2010-02-07 13:06:54 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2010-02-07 13:06:54 +0000 |
| commit | 0b8fba3401365a4c631598b81b25a3df3f20479b (patch) | |
| tree | e87a8a126aa06627df55ee2daea2b7f659ee8741 | |
| parent | 6652657f12f0fdbd017b6a0d1a6789dad69ab55d (diff) | |
| download | php-git-0b8fba3401365a4c631598b81b25a3df3f20479b.tar.gz | |
- Fixed #44098, imap_utf8() returns only capital letters
| -rw-r--r-- | ext/imap/config.m4 | 10 | ||||
| -rw-r--r-- | ext/imap/php_imap.c | 2 | ||||
| -rw-r--r-- | ext/imap/tests/bug44098.phpt | 20 |
3 files changed, 26 insertions, 6 deletions
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index b1ef9d96e2..d97288b27b 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -141,23 +141,23 @@ if test "$PHP_IMAP" != "no"; then old_CFLAGS=$CFLAGS CFLAGS="-I$IMAP_INC_DIR" - AC_CACHE_CHECK(for U8T_CANONICAL, ac_cv_u8t_canonical, + AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_canonical, AC_TRY_COMPILE([ #include <c-client.h> ],[ int i = U8T_CANONICAL; ],[ - ac_cv_u8t_canonical=yes + ac_cv_u8t_decompose=yes ],[ - ac_cv_u8t_canonical=no + ac_cv_u8t_decompose=no ]) ) CFLAGS=$old_CFLAGS - if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then + if test "$ac_cv_u8t_decompose" = "no" && test "$ac_cv_utf8_mime2text" = "new"; then AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.]) fi - if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then + if test "$ac_cv_u8t_decompose" = "yes" && test "$ac_cv_utf8_mime2text" = "old"; then AC_MSG_ERROR([utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. Check config.log for additional information.]) fi diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index d30113d128..829276023f 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2277,7 +2277,7 @@ PHP_FUNCTION(imap_utf8) #ifndef HAVE_NEW_MIME2TEXT utf8_mime2text(&src, &dest); #else - utf8_mime2text(&src, &dest, U8T_CANONICAL); + utf8_mime2text(&src, &dest, U8T_DECOMPOSE); #endif RETVAL_STRINGL(dest.data, dest.size, 1); if (dest.data) { diff --git a/ext/imap/tests/bug44098.phpt b/ext/imap/tests/bug44098.phpt new file mode 100644 index 0000000000..f758c117b6 --- /dev/null +++ b/ext/imap/tests/bug44098.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #44098 (imap_utf8() returns only capital letters) +--SKIPIF-- +<?php + if (!extension_loaded("imap")) { + die("skip imap extension not available"); + } +?> +--FILE-- +<?php +$exp = 'Luzon®14 dot CoM'; +$res = imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM'); +if ($res != $exp) { + echo "failed: got <$res>, expected <exp>\n"; +} else { + echo "ok"; +} +?> +--EXPECT-- +ok |
