Fix "mb_convert_encoding(): Handling HTML entities via mbstring is deprecated" warning with PHP 8.2

Created on 22 January 2024, 8 months ago
Updated 5 February 2024, 8 months ago

Problem/Motivation

When using PHP 8.2, the following warning is displayed repeatedly:

Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /var/www/html/docroot/modules/contrib/media_link_enhancements/src/MediaLinkEnhancementsAlterLinks.php on line 98

Steps to reproduce

Install version 1.0.4 on a Drupal site with PHP 8.2 and go to any page.

Proposed resolution

Switch from using mb_convert_encoding to use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead.

Remaining tasks

Make PR with fix.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇺🇸United States SamLerner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024