Bug #80201 [Com]: incomplete header returned

From: Date: Thu, 08 Jul 2021 20:41:34 +0000
Subject: Bug #80201 [Com]: incomplete header returned
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-234924@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80201&edit=1 ID: 80201 Comment by: deffstroke88 at protonmail dot com Reported by: smile dot 80 at bk dot ru Summary: incomplete header returned Status: Analyzed Type: Bug Package: IMAP related Operating System: linux/windows PHP Version: 7.4.11 Block user comment: N Private report: N New Comment: Thank you, I will try this solution on my project solution https://buzzword.digital/ Previous Comments: ------------------------------------------------------------------------ [2020-10-19 08:09:19] cmb@php.net Form the mail_fetchheader_full() documentation: | If the len argument is non-NIL, it holds a pointer in which the | length of the string in octets is returned. This is useful in | cases where there may be an embedded null in the string. We do pass NIL to mail_fetchheader_full(), though, and as such imap_fetchheader() truncates the string. The fix is trivial, but while investigating further I found bug #80203, and it seems to me there are more cases where the IMAP extension does not properly handle NUL bytes. ------------------------------------------------------------------------ [2020-10-07 18:41:54] smile dot 80 at bk dot ru Description: ------------ --- From manual page: https://php.net/function.imap-fetchheader --- It is difficult to describe the error. The letter header contains the # 00 symbol in the header value. It is included in the ASCII table and does not contradict RFC 2822. Imap_fetchheader returns all headers up to # 00. For example heading: Message-Id: <20201007090331 .3VdeNwPA @ mxfront10o.mail.yandex.net> Where after ..0331 (# 00) The function will return (string) "Message-Id: <20201007090331" Test script: --------------- imap_fetchheader ( $imap_stream , $$msg_number ); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=80201&edit=1

« previous php.bugs (#234924) next »