|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35290 imap_8bit does not encode ending spaces correctly
Submitted: 2005-11-19 06:16 UTC Modified: 2005-11-19 07:08 UTC
From: slusarz at curecanti dot org Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.0.5 OS: Fedora 3
Private report: No CVE-ID: None
 [2005-11-19 06:16 UTC] slusarz at curecanti dot org
imap_8bit() is broken when it comes to spaces at the end of a line.  According to RFC 2045 [6.7(3)]:

Octets with values of 9 and 32 MAY be represented as US-ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line.

imap_8bit does nothing to the following line:

the correct encoding would be as follows:

Reproduce code:
echo imap_8bit('foo ');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-19 07:08 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The php function is a direct wrapper around the rfc822_8bit() c-client function. So the bug is in the c-client lib and not PHP.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 04 01:01:27 2023 UTC