]> granicus.if.org Git - php/commitdiff
- Fixed #44098, imap_utf8() returns only capital letters
authorPierre Joye <pajoye@php.net>
Sun, 7 Feb 2010 13:06:54 +0000 (13:06 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 7 Feb 2010 13:06:54 +0000 (13:06 +0000)
ext/imap/config.m4
ext/imap/php_imap.c
ext/imap/tests/bug44098.phpt [new file with mode: 0644]

index b1ef9d96e283add5c0d5377b53f8c5b03f49cce9..d97288b27b9fc66e6eff243ce1da92626784ecc8 100644 (file)
@@ -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
 
index d30113d1287aa5aa4723184d1378f0a99e204bbc..829276023f920cdcc2e1e8b482cc75ec09634446 100644 (file)
@@ -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 (file)
index 0000000..f758c11
--- /dev/null
@@ -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