indieweb / mention-client-php

Client library for sending webmention and pingback notifications
https://indieweb.org/webmention
97 stars 19 forks source link

mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding #42

Closed lazaruscorporation closed 1 year ago

lazaruscorporation commented 1 year ago

I'm using the 'sendMentions()' method (using PHP 8.1), and while it does seem to be sending the Webmentions, it terminates in a 500 error:

CRITICAL - 2023-10-13 17:09:19 --> mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding in VENDORPATH/mf2/mf2/Mf2/Parser.php on line 96. 1 VENDORPATH/mf2/mf2/Mf2/Parser.php(96): mb_convert_encoding() 2 VENDORPATH/mf2/mf2/Mf2/Parser.php(365): Mf2\unicodeToHtmlEntities() 3 VENDORPATH/indieweb/mention-client/src/IndieWeb/MentionClient.php(156): Mf2\Parser->__construct() 4 VENDORPATH/indieweb/mention-client/src/IndieWeb/MentionClient.php(240): IndieWeb\MentionClient->_parseBody() 5 VENDORPATH/indieweb/mention-client/src/IndieWeb/MentionClient.php(418): IndieWeb\MentionClient->discoverWebmentionEndpoint() 6 VENDORPATH/indieweb/mention-client/src/IndieWeb/MentionClient.php(400): IndieWeb\MentionClient->sendFirstSupportedMention() 7 APPPATH/Controllers/Blogpost.php(24): IndieWeb\MentionClient->sendMentions() ...

Am I doing something wrong, or is this a bug?

lazaruscorporation commented 1 year ago

Sorry, looking at the comments on https://www.php.net/manual/en/function.mb-detect-encoding.php I think this might be an undocumented breaking change since PHP 8.1.7 - I'll open an issue on the Mf2 repo