-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
PHP 8.2: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated #44281
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
Closed
Tracked by
#44282
Labels
Bug
Help wanted
Issues and PRs which are looking for volunteers to complete them.
Status: Reviewed
VarDumper
Comments
Confirmed. |
@gharlan would you be able to work on a PR to get rid of this deprecation? It should target branch 4.4 |
@nicolas-grekas Why did you close the issue? |
Bad button :) |
Possible Solution: $string = "<div><p>tèé Заматеріалами \"&'+</p></div>";
echo "Original:".mb_convert_encoding($string, 'HTML-ENTITIES', 'UTF-8');
echo "\n";
echo "Solution:".mb_encode_numericentity(
htmlspecialchars_decode(
htmlentities($string, ENT_NOQUOTES, 'UTF-8', false)
,ENT_NOQUOTES
), [0x80, 0x10FFFF, 0, ~0],
'UTF-8'
);
echo "\n"; |
Genyus
added a commit
to frocentric/wordpress
that referenced
this issue
Apr 1, 2024
Avoids deprecation warning from call to `mb_convert_encoding()`. See symfony/symfony#44281 (comment) for details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Help wanted
Issues and PRs which are looking for volunteers to complete them.
Status: Reviewed
VarDumper
Symfony version(s) affected
4.4, 5.3, 5.4, 6.0
Description
Using the mbstring "encoding"
HTML-ENTITIES
is deprecated since PHP 8.2: php/php-src#7177These occurrences should be replaced: https://github.com/symfony/symfony/search?q=html-entities
How to reproduce
Use HtmlDumper from var-dumper component in php 8.2.
Possible Solution
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: