javanile / php-imap2

PHP IMAP with OAUTH2
https://php-imap2.javanile.org/
GNU General Public License v3.0
48 stars 28 forks source link

imap_mime_header_decode non-equivalence? #51

Open maxwellc-dal opened 1 year ago

maxwellc-dal commented 1 year ago

Scenario: I am using an OO library (https://github.com/barbushin/php-imap) that sits on top of imap_* calls, so I tried running having removed the php_imap module, and depending on bootstrap.php to define imap_mime_header_decode as a call to imap2_mime_header_decode.

Problem: imap2_mime_header_decode generates equivalent output if IMAP2_RETROFIT_MODE is enabled by calling imap_mime_header_decode. Without IMAP2_RETROFIT_MODE it calls Polyfill::mimeHeaderDecode, which returns the string input untransformed. imap_mime_header_decode () is supposed to return an array of (string fragment, encoding) tuples.

Is Polyfill::mimeHeaderDecode a placeholder for future work, or is this a deliberate choice that the original functionality is an oddity? I am trying to figure out if I should propose a PHP implementation, or if there is a reason for this.