Fix soundasleep/html2text PHP 8.2 deprecation notices

[MAILPOET-4875]
This commit is contained in:
alex-mailpoet
2023-01-25 16:31:09 +03:00
committed by Aschepikov
parent a11a462eee
commit c6a3e08c34

View File

@@ -18,6 +18,19 @@ $replacements = [
'protected $backgroundColor = null;' . PHP_EOL . ' protected $background = null;' . PHP_EOL . ' /**',
],
],
[
'file' => __DIR__ . '/../vendor/soundasleep/html2text/src/Html2Text.php',
'find' => [
'$html = mb_convert_encoding($html, "HTML-ENTITIES", "UTF-8");',
],
'replace' => [
'// HTML-ENTITIES mbstring encoder is deprecated since PHP 8.2,' . PHP_EOL .
"\t\t\t" . '// replaced by htmlentities() and htmlspecialchars_decode() as per' . PHP_EOL .
"\t\t\t" . '// https://php.watch/versions/8.2/mbstring-qprint-base64-uuencode-html-entities-deprecated#html' . PHP_EOL .
"\t\t\t" . '$html = htmlentities($html);' . PHP_EOL .
"\t\t\t" . '$html = htmlspecialchars_decode($html);',
],
],
];
// Apply replacements