Skip to content
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

PHP 8.0: prevent ValueError for invalid encoding #657

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Aug 11, 2020

Check the encoding against the list of supported encodings before ever calling mb_convert_encoding().

This prevents a fatal ValueError on PHP 8.0 when passing an invalid encoding and maintains the documented behaviour of returning false on an invalid encoding.

Check the encoding against the list of supported encodings before ever calling `mb_convert_encoding()`.
@jrfnl
Copy link
Contributor Author

jrfnl commented Aug 11, 2020

FYI: alternatively the order can remain the same, but then the first condition should be wrapped in a try/catch.

@mblaney
Copy link
Member

mblaney commented Aug 12, 2020

hi @jrfnl that's ok I think flipping it the way you have is fine. Thanks for all these changes they look good to me!

@mblaney mblaney merged commit deddccd into simplepie:master Aug 12, 2020
@jrfnl jrfnl deleted the feature/php-8.0-prevent-valueerror branch August 12, 2020 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants