php.net |  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:
 [2005-11-19 06:16 UTC] slusarz at curecanti dot org
Description:
------------
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:
foo<SPACE>

the correct encoding would be as follows:
foo=20

Reproduce code:
---------------
echo imap_8bit('foo ');

Expected result:
----------------
foo=20

Actual result:
--------------
foo 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-19 07:08 UTC] iliaa@php.net
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 http://www.php.net/support.php 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-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 20:02:09 2014 UTC