|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53304 iconv_mime_docode() doesn't handle lowercase hex digits
Submitted: 2010-11-13 10:31 UTC Modified: 2010-11-25 22:38 UTC
From: daniel dot mueller at inexio dot net Assigned: iliaa (profile)
Status: Closed Package: ICONV related
PHP Version: 5.3SVN-2010-11-13 (snap) OS: all
Private report: No CVE-ID: None
 [2010-11-13 10:31 UTC] daniel dot mueller at inexio dot net
iconv_mime_docode() doesn't handle lowercase hex digits in Q-encoding.

According rfc2047 hex digits should be in uppercase, but it must not be in this way.

=c3=bc - gives error
=C3=BC - works

Test script:
echo iconv_mime_decode('=?utf-8?Q?', 0, 'UTF-8') . "\n";
echo iconv_mime_decode('=?utf-8?Q?', 0, 'UTF-8') . "\n";

Expected result:
Nachricht über Kontaktformular
Nachricht über Kontaktformular

Actual result:
Notice: iconv_mime_decode(): Unknown error (25) in /usr/home/dm/test.php on line 3

Nachricht über Kontaktformular


bugfix-53304 (last revision 2010-11-17 18:18 UTC by daniel dot mueller at inexio dot net)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-17 19:36 UTC] daniel dot mueller at inexio dot net
-Operating System: FreeBSD 7.2-RELEASE +Operating System: all
 [2010-11-17 19:36 UTC] daniel dot mueller at inexio dot net
I have attached a fix for this problem.

The patch changes php_quot_print_decode() in ext/standard/quot_print.c so,
that it accepts the lowercase hex digits a-f.

This function seems currently only used for mime header decoding according 
rfc2047 in ext/iconv/iconv.c

However rfc2045 defines lowercase characters as illegal, but allows to recognize 
them as the corresponding uppercase letters in decoding.
 [2010-11-23 13:57 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: aharvey
 [2010-11-25 22:38 UTC]
Automatic comment from SVN on behalf of iliaa
Log: Fixed bug #53304 (quot_print_decode does not handle lower-case hex digits)
 [2010-11-25 22:38 UTC]
-Status: Assigned +Status: Closed -Assigned To: aharvey +Assigned To: iliaa
 [2010-11-25 22:38 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 21:01:25 2023 UTC