From:             nidhikaushal28 at gmail dot com
Operating system: Windows 7, CentOS
PHP version:      5.3.20
Package:          ICONV related
Bug Type:         Bug
Bug description:iconv_mime_decode_headers function is skipping headers

Description:
------------
iconv_mime_decode_headers function is skipping headers when '=?' is present
in the subject. 

For example if the subject header of a mime message is : 
Subject: Reply Is? white side-LED =? in Help

Then the rest of the headers after subject like content-type, date etc are
not returned. Similar bug is filed https://bugs.php.net/bug.php?id=52941
but in the above mentioned example the subject is not encoded. 

My php version is 5.3.3 and the issue is reproducible in 5.3.20 and 5.4.10.


Test script:
---------------
<?php
$headers = 'From: "xyz" <[email protected]>
To: <[email protected]>
Subject: Reply Is? white side-LED =? in Help
Date: Sat, 22 Dec 2012
Message-ID: <006f01cde00e$d9f79da0$8de6d8e0>
MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="----=_NextPart_000_0070_01CDE03C.F3AFD9A0"
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Ac3gDtcH2huHjzYcQVmFJPPoWjJogA==
Content-Language: en-us

';
$headers = iconv_mime_decode_headers($headers,
ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
print_r($headers);
?>

Expected result:
----------------
Array
(
    [From] => "xyz" <[email protected]>
    [To] => <[email protected]>
    [Subject] => Reply Is? white side-LED =? in Help
    [Date] => Sat, 22 Dec 2012
    [Message-ID] => <006f01cde00e$d9f79da0$8de6d8e0>
    [MIME-Version] => 1.0
    [Content-Type] => multipart/alternative;
boundary="----=_NextPart_000_0070_0
1CDE03C.F3AFD9A0"
    [X-Mailer] => Microsoft Office Outlook 12.0
    [Thread-Index] => Ac3gDtcH2huHjzYcQVmFJPPoWjJogA==
    [Content-Language] => en-us
)

Actual result:
--------------
Array
(
    [From] => "xyz" <[email protected]>
    [To] => <[email protected]>
    [Subject] => Reply Is? white side-LED
)


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63839&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63839&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63839&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63839&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63839&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63839&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63839&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63839&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63839&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63839&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63839&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63839&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63839&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63839&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63839&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63839&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63839&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63839&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63839&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63839&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63839&r=mysqlcfg

Reply via email to