pajoye                                   Sun, 07 Feb 2010 13:06:54 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=294699

Log:
- Fixed #44098, imap_utf8() returns only capital letters

Bug: http://bugs.php.net/44098 (No Feedback) imap_utf8() returns only capital 
letters
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/ext/imap/config.m4
    U   php/php-src/branches/PHP_5_2/ext/imap/php_imap.c
    A   php/php-src/branches/PHP_5_2/ext/imap/tests/bug44098.phpt
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/imap/config.m4
    U   php/php-src/branches/PHP_5_3/ext/imap/config.w32
    U   php/php-src/branches/PHP_5_3/ext/imap/php_imap.c
    A   php/php-src/branches/PHP_5_3/ext/imap/tests/bug44098.phpt
    U   php/php-src/branches/PHP_5_3_2/ext/imap/config.m4
    U   php/php-src/branches/PHP_5_3_2/ext/imap/config.w32
    U   php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c
    A   php/php-src/branches/PHP_5_3_2/ext/imap/tests/bug44098.phpt
    U   php/php-src/trunk/ext/imap/config.m4
    U   php/php-src/trunk/ext/imap/config.w32
    U   php/php-src/trunk/ext/imap/php_imap.c
    A   php/php-src/trunk/ext/imap/tests/bug44098.phpt

Modified: php/php-src/branches/PHP_5_2/ext/imap/config.m4
===================================================================
--- php/php-src/branches/PHP_5_2/ext/imap/config.m4	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_2/ext/imap/config.m4	2010-02-07 13:06:54 UTC (rev 294699)
@@ -141,23 +141,23 @@

     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


Modified: php/php-src/branches/PHP_5_2/ext/imap/php_imap.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/imap/php_imap.c	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_2/ext/imap/php_imap.c	2010-02-07 13:06:54 UTC (rev 294699)
@@ -2277,7 +2277,7 @@
 #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) {

Added: php/php-src/branches/PHP_5_2/ext/imap/tests/bug44098.phpt
===================================================================
--- php/php-src/branches/PHP_5_2/ext/imap/tests/bug44098.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_2/ext/imap/tests/bug44098.phpt	2010-02-07 13:06:54 UTC (rev 294699)
@@ -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

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3/NEWS	2010-02-07 13:06:54 UTC (rev 294699)
@@ -69,8 +69,9 @@
 - Fixed bug #47281 ($php_errormsg is limited in size of characters)
   (Oracle Corp.)
 - Fixed bug #44827 (define() allows :: in constant names). (Ilia)
+- Fixed bug #44098 (imap_utf8() returns only capital letters).
+  (steffen at dislabs dot de, Pierre)

-
 ?? ??? 20??, PHP 5.3.2
 - Upgraded bundled sqlite to version 3.6.21. (Ilia)
 - Upgraded bundled PCRE to version 8.00. (Scott)

Modified: php/php-src/branches/PHP_5_3/ext/imap/config.m4
===================================================================
--- php/php-src/branches/PHP_5_3/ext/imap/config.m4	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3/ext/imap/config.m4	2010-02-07 13:06:54 UTC (rev 294699)
@@ -147,23 +147,23 @@

     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


Modified: php/php-src/branches/PHP_5_3/ext/imap/config.w32
===================================================================
--- php/php-src/branches/PHP_5_3/ext/imap/config.w32	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3/ext/imap/config.w32	2010-02-07 13:06:54 UTC (rev 294699)
@@ -21,6 +21,7 @@
 		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");
 	}

Modified: php/php-src/branches/PHP_5_3/ext/imap/php_imap.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/imap/php_imap.c	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3/ext/imap/php_imap.c	2010-02-07 13:06:54 UTC (rev 294699)
@@ -2664,7 +2664,7 @@
 #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) {

Added: php/php-src/branches/PHP_5_3/ext/imap/tests/bug44098.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/imap/tests/bug44098.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/imap/tests/bug44098.phpt	2010-02-07 13:06:54 UTC (rev 294699)
@@ -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

Modified: php/php-src/branches/PHP_5_3_2/ext/imap/config.m4
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/imap/config.m4	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3_2/ext/imap/config.m4	2010-02-07 13:06:54 UTC (rev 294699)
@@ -147,23 +147,23 @@

     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


Modified: php/php-src/branches/PHP_5_3_2/ext/imap/config.w32
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/imap/config.w32	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3_2/ext/imap/config.w32	2010-02-07 13:06:54 UTC (rev 294699)
@@ -21,6 +21,7 @@
 		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");
 	}

Modified: php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/branches/PHP_5_3_2/ext/imap/php_imap.c	2010-02-07 13:06:54 UTC (rev 294699)
@@ -2664,7 +2664,7 @@
 #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) {

Added: php/php-src/branches/PHP_5_3_2/ext/imap/tests/bug44098.phpt
===================================================================
--- php/php-src/branches/PHP_5_3_2/ext/imap/tests/bug44098.phpt	                        (rev 0)
+++ php/php-src/branches/PHP_5_3_2/ext/imap/tests/bug44098.phpt	2010-02-07 13:06:54 UTC (rev 294699)
@@ -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

Modified: php/php-src/trunk/ext/imap/config.m4
===================================================================
--- php/php-src/trunk/ext/imap/config.m4	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/trunk/ext/imap/config.m4	2010-02-07 13:06:54 UTC (rev 294699)
@@ -147,24 +147,24 @@

     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
-		AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. You may not have c-client installed properly. Check config.log for additional information.])
+    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
-		AC_MSG_ERROR([utf8_mime2text() has old signature, but U8T_CANONICAL is present. This should not happen. You may not have c-client installed properly. Check config.log for additional information.])
+    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

     dnl Check for c-client version 2001

Modified: php/php-src/trunk/ext/imap/config.w32
===================================================================
--- php/php-src/trunk/ext/imap/config.w32	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/trunk/ext/imap/config.w32	2010-02-07 13:06:54 UTC (rev 294699)
@@ -21,6 +21,7 @@
 		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");
 	}

Modified: php/php-src/trunk/ext/imap/php_imap.c
===================================================================
--- php/php-src/trunk/ext/imap/php_imap.c	2010-02-07 12:08:22 UTC (rev 294698)
+++ php/php-src/trunk/ext/imap/php_imap.c	2010-02-07 13:06:54 UTC (rev 294699)
@@ -1169,6 +1169,7 @@

 	if (params) {
 		zval **disabled_auth_method;
+
 		if (zend_hash_find(HASH_OF(params), "DISABLE_AUTHENTICATOR", sizeof("DISABLE_AUTHENTICATOR"), (void **)&disabled_auth_method) == SUCCESS) {
 			switch (Z_TYPE_PP(disabled_auth_method)) {
 				case IS_STRING:
@@ -2662,7 +2663,7 @@
 #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) {

Added: php/php-src/trunk/ext/imap/tests/bug44098.phpt
===================================================================
--- php/php-src/trunk/ext/imap/tests/bug44098.phpt	                        (rev 0)
+++ php/php-src/trunk/ext/imap/tests/bug44098.phpt	2010-02-07 13:06:54 UTC (rev 294699)
@@ -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
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to