Home » Networking » Net_IMAP » Bug #3638
function _getAddressList only returns one address even when multiple are there
Details
| Submitted | 2005-02-28 15:14 UTC |
|---|---|
| From | jamesr at totalinfosecurity dot com |
| Assigned | amistry |
| Status | No Feedback |
| Package | Net_IMAP |
| PHP Version | 5.0.2 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-02-28 15:14 UTC] jamesr at totalinfosecurity dot com
Description:
------------
The function _getAddressList has a bug that prevents it from returning more than one address for each header (To, CC, BCC, etc.). The problem is there is an "if" statement that should be a "foreach" and the statement assigning the address info to the array is outsid the loop.
Due to this bug, when Net_IMAPProtocol parses a message that has multiple addresses in the To, Bcc, Cc, From or ReplyTo fields, it only returns the first address and skips all the rest.
I have created a patch that fixes this problem. See below:
Reproduce code:
---------------
http://www.totalinfosecurity.com/patches/netimappatches.php
Expected result:
----------------
When multiple addresses are specified, the resulting array should contain all of them. For example:
['TO'][0]['EMAIL'] = foo@bar.com
['TO'][1]['EMAIL'] = boo@far.com
['TO'][2]['EMAIL'] = foob@barf.com
Actual result:
--------------
Only the first address is returned.
['TO'][0]['EMAIL'] = foo@bar.com
[2006-03-22 04:53 UTC] amistry at php dot net
I've fixed this in the CVS. Would you please verify that it works for you?