truncator fix

This commit is contained in:
Andy Miller 2023-05-10 08:34:09 -06:00
parent 814a050858
commit 9da8cad7fe
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,9 @@
# v1.7.41.1
## 05/10/2023
1. [](#bugfix)
* Fixed certain UTF-8 characters breaking `Truncator` class [#3716](https://github.com/getgrav/grav/issues/3716)
# v1.7.41
## 05/09/2023

View File

@ -144,7 +144,7 @@ class Truncator
}
// Transform multibyte entities which otherwise display incorrectly.
$html = htmlspecialchars_decode(iconv('UTF-8', 'ISO-8859-1', htmlentities($html, ENT_COMPAT, 'UTF-8')), ENT_QUOTES);
$html = mb_encode_numericentity($html, [0x80, 0x10FFFF, 0, ~0], 'UTF-8');
// Internal errors enabled as HTML5 not fully supported.
libxml_use_internal_errors(true);