Skip to content

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.

2 participants