From: Pierre Joye Date: Sun, 7 Feb 2010 13:06:54 +0000 (+0000) Subject: - Fixed #44098, imap_utf8() returns only capital letters X-Git-Tag: php-5.3.2RC2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d51db88d0cb4b1b6d0ae970f4a5ced0e7e48c2e;p=php - Fixed #44098, imap_utf8() returns only capital letters --- diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index ec777ce228..3ad7c107dd 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -147,23 +147,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 ],[ 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/config.w32 b/ext/imap/config.w32 index beb12f03e8..5778c34bb4 100644 --- a/ext/imap/config.w32 +++ b/ext/imap/config.w32 @@ -21,6 +21,7 @@ if (PHP_IMAP == "yes") { AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Have utf8_mime2text', true); AC_DEFINE('HAVE_RFC822_OUTPUT_ADDRESS_LIST', 1, 'Have rfc822_output_address_list', true); AC_DEFINE('HAVE_IMAP_MUTF7', 1, 'Have modified utf7 support', true); + AC_DEFINE('HAVE_NEW_MIME2TEXT', 1, 'Whether utf8_mime2text() has new signature'); } else { WARNING("imap not enabled; libraries and headers not found"); } diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index aaf1c96b64..5e47510d48 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2664,7 +2664,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-- + +--FILE-- +, expected \n"; +} else { + echo "ok"; +} +?> +--EXPECT-- +ok