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

mb_convert_encoding deprecated #382

Open
dshanske opened this issue Apr 13, 2023 · 2 comments
Open

mb_convert_encoding deprecated #382

dshanske opened this issue Apr 13, 2023 · 2 comments

Comments

@dshanske
Copy link
Collaborator

mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in webmention/includes/class-response.php on line 160

@edent
Copy link
Contributor

edent commented Oct 30, 2023

Just got this error:

PHP Fatal error:  Uncaught ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding in /wp-content/plugins/webmention/includes/class-response.php:160
Stack trace:
#0 /wp-content/plugins/webmention/includes/class-response.php(160): mb_convert_encoding()
#1 /wp-content/plugins/webmention/includes/class-discovery.php(187): Webmention\Response->get_dom_document()
#2 /wp-content/plugins/webmention/includes/functions.php(259): Webmention\Discovery::discover_endpoint()
#3 /wp-content/plugins/webmention/includes/class-sender.php(104): webmention_discover_endpoint()
#4 /wp-content/plugins/webmention/includes/class-sender.php(181): Webmention\Sender::send_webmention()
#5 /wp-content/plugins/webmention/includes/class-sender.php(299): Webmention\Sender::send_webmentions()
#6 /wp-includes/class-wp-hook.php(310): Webmention\Sender::do_webmentions()
#7 /wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
#8 /wp-includes/plugin.php(565): WP_Hook->do_action()
#9 /wp-cron.php(191): do_action_ref_array()
#10 {main}
  thrown in /wp-content/plugins/webmention/includes/class-response.php on line 160

@edent
Copy link
Contributor

edent commented Apr 29, 2024

Still seeing this.

PHP Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /wp-content/plugins/webmention/includes/class-response.php on line 183

libxml_use_internal_errors( true );
if ( function_exists( 'mb_convert_encoding' ) ) {
$body = mb_convert_encoding( $body, 'HTML-ENTITIES', mb_detect_encoding( $body ) );
}

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

No branches or pull requests

2 participants