Fix Mailbox testBadInput test on PHP 8.2 #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Horde_Imap_Client_Data_Format_Mailbox_MailboxTest::testBadInput
fails on PHP 8.2.This is due to
mb_convert_encoding("foo\0", 'UTF7-IMAP', 'UTF-8');
producingfoo&AAA-
on PHP 8.2, andfoo\0
on prior versions. See https://onlinephp.io/c/20a6. The change in data means the stream is no longer considered to contain "binary" data and so theparent::binary()
check fails.The change in
mb_convert_encoding
behaviour doesn't appear to be documented, but is covered at https://github.com/php/php-src/blob/b96b88b669370e1d85b6e98e359649d73b548029/ext/mbstring/tests/utf7imap_encoding.phpt#L29It's unclear to me if this change is correct... @slusarz wrote the test back in 2014.