On Tue, Jul 10, 2018 at 10:30 AM, Jan Ehrhardt <php...@ehrhardt.nl> wrote:

> While trying to make the mailparse extension fit for PHP 7.3 I ran into
> changes in the libmbfl API. I cannot find any documentation on this
> change.
>
> The change was introduced in this commit by nikic:
> https://github.com/php/php-src/commit/b3c1d9d1118438a3dae3544447db2b
> 39ca5cfa25
>
> To be specific:
> https://github.com/php/php-src/commit/b3c1d9d1118438a3dae3544447db2b
> 39ca5cfa25#diff-929fd74a8732776fa8776939a9b907d4L71
>
> It broke the code of the mailparse extension at this line:
> https://github.com/php/pecl-mail-mailparse/blob/master/
> php_mailparse_mime.c#L910
>
> Shouldn't the be documented? And/or is there an easy fix?
>

Thanks for pointing this out, this should be added to UPGRADING.INTERNALS.
mbstring and libmbfl underwent some larger refactorings in PHP 7.3, to make
its performance less abysmally bad.

The change you are running into is that many APIs have changed from working
with enum mbfl_no_encoding to const mbfl_encoding *. You will have to
mirror these changes: For example, instead of passing mbfl_no_encoding_8bit
to a function, you use &mbfl_encoding_8bit. Instead of calling
mbfl_name2no_encoding(part->content_transfer_encoding) you instead use
mbfl_name2encoding(part->content_transfer_encoding) and so on.

Nikita

Reply via email to