php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44098 imap_utf8() returns only capital letters
Submitted: 2008-02-11 11:30 UTC Modified: 2010-02-07 15:32 UTC
Votes:44
Avg. Score:4.5 ± 0.8
Reproduced:41 of 42 (97.6%)
Same Version:19 (46.3%)
Same OS:3 (7.3%)
From: steffen at dislabs dot de Assigned: pajoye (profile)
Status: Closed Package: IMAP related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
 [2008-02-11 11:30 UTC] steffen at dislabs dot de
Description:
------------
using imap_utf8 returns only capitols.
This behavior changed with 5.2.5 as it worked in 5.2.4 correct.

Reproduce code:
---------------
echo imap_utf8('=?iso-8859-1?b?THV6b26uMTQ=?= dot CoM');

Expected result:
----------------
Luzon?14 dot CoM

Actual result:
--------------
LUZON?14 DOT COM

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-29 22:54 UTC] sbs at hushmail dot com
This is because if you compile against a recent version of the imap c-client library, the U8T_CANONICAL flag is passed to utf8_mime2text, which canonicalizes case.  To fix, instead the U8T_DECOMPOSE compose flag can be used.  No flag at all would likely be fine as well.

Here's a patch I used against 5.2.11.

diff -r -u php-5.2.11/configure php-5.2.11-u8t_decompose-patch/configure
+++ php-5.2.11-u8t_decompose-patch/configure	2009-10-29 15:23:14.000000000 -0700
-if eval "test \"`echo '$''{'ac_cv_u8t_canonical'+set}'`\" = set"; then
+if eval "test \"`echo '$''{'ac_cv_u8t_decompose'+set}'`\" = set"; then
-         ac_cv_u8t_canonical=yes
+         ac_cv_u8t_decompose=yes
-         ac_cv_u8t_canonical=no
+         ac_cv_u8t_decompose=no
-echo "$ac_t""$ac_cv_u8t_canonical" 1>&6
+echo "$ac_t""$ac_cv_u8t_decompose" 1>&6
-    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
-    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
diff -r -u php-5.2.11/ext/imap/config.m4 php-5.2.11-u8t_decompose-patch/ext/imap/config.m4
+++ php-5.2.11-u8t_decompose-patch/ext/imap/config.m4	2009-10-29 15:21:22.000000000 -0700
-    AC_CACHE_CHECK(for U8T_CANONICAL, ac_cv_u8t_canonical,
+    AC_CACHE_CHECK(for U8T_DECOMPOSE, ac_cv_u8t_decompose,
-         ac_cv_u8t_canonical=yes
+         ac_cv_u8t_decompose=yes
-         ac_cv_u8t_canonical=no
+         ac_cv_u8t_decompose=no
-    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
-    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
diff -r -u php-5.2.11/ext/imap/php_imap.c php-5.2.11-u8t_decompose-patch/ext/imap/php_imap.c
+++ php-5.2.11-u8t_decompose-patch/ext/imap/php_imap.c	2009-10-29 15:21:38.000000000 -0700
 [2009-12-22 20:20 UTC] pajoye@php.net
Can you provide a link to the patch please?
 [2010-02-03 12:51 UTC] sebastian dot gerlach at digionline dot de
Hi,

i've changed the patch. It also works without changing the configure file.

http://digionline.de/sebastian.gerlach/imap-capital-letters.patch
 [2010-02-07 13:06 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294699
Log: - Fixed #44098, imap_utf8() returns only capital letters
 [2010-02-07 13:06 UTC] pajoye@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 01:01:27 2024 UTC