php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5194 imap_fetchheader does not work with UIDs
Submitted: 2000-06-22 21:54 UTC Modified: 2000-06-28 11:07 UTC
From: daboo at cyrusoft dot com Assigned:
Status: Closed Package: IMAP related
PHP Version: 3.0.16 OS: linux/x86 RH6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
46 - 37 = ?
Subscribe to this entry?

 
 [2000-06-22 21:54 UTC] daboo at cyrusoft dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-28 11:07 UTC] hholzgra at cvs dot php dot net
php4 code had already been backported shortly
after 3.0.16 was out
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 19:01:29 2024 UTC