Case folding with following whitespace in MIME headers

From: Date: Fri, 23 Apr 2021 13:48:30 +0000
Subject: Case folding with following whitespace in MIME headers
Groups: php.internals 
Request: Send a blank email to internals+get-114109@lists.php.net to get a copy of this message
Hi all, while working on a fix[1] for bug #80259[2], I noticed that iconv_mime_decode() and mb_decode_mimeheader() collapse all whitespace after a case folding marker (CRLF) to a single space[3]. This appears to be in violation of RFC 5322, section 2.2.3: | Unfolding is accomplished by simply removing any CRLF | that is immediately followed by WSP. imap_utf8() properly keeps the whitespace. (ext/imap is not available on 3v4l.org) I wonder whether it's worth to fix it, due to the obvious BC break, or whether we want to treat that as a documentation issue. If we're going for a fix (what I would suggest), which version should that target? [1] <https://github.com/php/php-src/pull/6865> [2] <https://bugs.php.net/80259> [3] <https://3v4l.org/E92VT> -- Christoph M. Becker

« previous php.internals (#114109) next »