-
Notifications
You must be signed in to change notification settings - Fork 1.9k
refactor: DOMParser::withString() for PHP 8.2 #6672
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
refactor: DOMParser::withString() for PHP 8.2 #6672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having a hard time finding a clear answer: are you sure these are the same?
Compare: Kristories/symfony@eea3b10 |
The latest code in Symfony is different. $this->line = htmlspecialchars_decode(utf8_decode(htmlentities($this->line, ENT_COMPAT, 'UTF-8', false))); $this->line = mb_encode_numericentity($this->line, [0x80, 0x10FFFF, 0, 0x1FFFFF], 'UTF-8'); |
No. The following tests fail with this PR. --- a/tests/system/Test/DOMParserTest.php
+++ b/tests/system/Test/DOMParserTest.php
@@ -80,8 +80,9 @@ final class DOMParserTest extends CIUnitTestCase
public function provideText()
{
return [
- ['Hello World'],
- ['Hellö Wörld'],
+ 'en' => ['Hello World'],
+ 'sv' => ['Hej, världen'],
+ 'ja' => ['こんにちは、世界'],
];
}
|
I changed the code, and test case. |
Have you |
b12e15e
to
d88f555
Compare
mb_convert_encoding($str, 'HTML-Entities') is deprecated in PHP 8.2.
This code comes from Symfony Dumper. https://github.com/symfony/symfony/blob/b527899f4fb4355fd356eef6f910ea67c5f86192/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php#L939 I'm not sure this is perfect.
d88f555
to
a83d410
Compare
I think this PR is ready to merge. |
Thanks for the reviews! |
Description
See #6170
See https://php.watch/versions/8.2/mbstring-qprint-base64-uuencode-html-entities-deprecated
mb_convert_encoding($str, 'HTML-Entities')
is deprecated in PHP 8.2.Checklist: