Bug #5194: imap_fetchheader does not work with UIDs
| From: | daboo at cyrusoft dot com | Date: | Thu, 22 Jun 2000 19:54:44 +0000 |
| Subject: | Bug #5194: imap_fetchheader does not work with UIDs | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22092@lists.php.net to get a copy of this message | ||
From: daboo@cyrusoft.com
Operating system: linux/x86 RH6.2
PHP version: 3.0.16
PHP Bug Type: IMAP related
Bug description: imap_fetchheader does not work with UIDs
In php3_imap_fetchheader (in the file functions/imap.c) a check is done to see that the passed-in
message number is within the correct range of message numbers. However, it fails to take into
account that the message number might actually be a UID if the flags parameter includes the FT_UID
option. If FT_UID is set in the flags, the message number range check should be skipped.
The following change works:
old code:
if (msgno->value.lval < 1) || (msgno->value.lval >
imap_le_struct->imap_stream->nmsgs) {
new code:
if (!(flags->value.lval & FT_UID) &&
(msgno->value.lval < 1) || (msgno->value.lval >
imap_le_struct->imap_stream->nmsgs)) {
NB A quick look at the PHP4 code indicates that this problem is resolved in a slightly different
manner there. You may prefer the PHP4 fix rather than the one I've done.