Skip to content

Fix GH-9008: mb_detect_encoding(): wrong results with null $encodings #9063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 20, 2022

Passing null to $encodings is supposed to behave like passing the
result of mb_detect_order(). Therefore, we need to remove the non-
encodings from the elist in this case as well. Thus, we duplicate
the global elist, so we can modify it.

Passing `null` to `$encodings` is supposed to behave like passing the
result of `mb_detect_order()`.  Therefore, we need to remove the non-
encodings from the `elist` in this case as well.  Thus, we duplicate
the global `elist`, so we can modify it.
@cmb69 cmb69 linked an issue Jul 20, 2022 that may be closed by this pull request
@cmb69 cmb69 marked this pull request as draft July 20, 2022 12:15
@cmb69 cmb69 marked this pull request as ready for review July 20, 2022 13:29
@cmb69 cmb69 requested a review from alexdowad July 20, 2022 13:29
@alexdowad
Copy link
Contributor

Thanks very much!! I was planning to fix this one, but it's great that you got to it first.

Copy link
Contributor

@alexdowad alexdowad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@cmb69 cmb69 closed this in c2bdaa4 Jul 20, 2022
@cmb69 cmb69 deleted the cmb/gh9008 branch July 20, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mb_detect_encoding(): wrong results with null $encodings
2 participants