php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5699 wrong date format in imap_headers()
Submitted: 2000-07-20 14:56 UTC Modified: 2000-07-21 17:50 UTC
From: vgon at mobilae dot ru Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.0.1pl2 OS: Solaris 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vgon at mobilae dot ru
New email:
PHP Version: OS:

 

 [2000-07-20 14:56 UTC] vgon at mobilae dot ru
 imap_headers() should return array of headers of e-mail
messages. Each header should include date field. This is
code from ext/imap/php_imap.c imap_headers function:
                mail_date(tmp+11, cache);
                tmp[18] = ' ';
                tmp[19] = '\0';
                mail_fetchfrom(tmp+19, ...
So, only 7 chars are reserved for date.
But this is description of mail_date() from imapd-4.5 :
     "This function accepts a message cache element that contains date information, and writes an IMAP-4 date string, that is, one in form:                      
        dd-mmm-yyyy hh:mm:ss +zzzz "

So, date field in header string looks like 
dd-mmm- ( 20-Jul- , for example )

Possible solution: 
	mail_date( tmp+11, cache );
	len = strlen( tmp );
	tmp[len] = ' ' ;
        tmp[len+1] = 0;
	mail_fetchfrom(tmp+len+1 ... 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-20 15:47 UTC] hholzgra at cvs dot php dot net
imap_headers() and it's fixed string layout 
is a dirty hack IMHO
i strongly recommend to use use imap_header()
instead


 [2000-07-21 17:50 UTC] hholzgra at cvs dot php dot net
column size for date increased in cvs
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC