mirror of
https://github.com/getgrav/grav.git
synced 2026-05-07 12:26:48 +02:00
Safer solution for getExcerptsFromHtml
Signed-off-by: Andy Miller <rhuk@mac.com>
This commit is contained in:
@@ -74,7 +74,7 @@ class Excerpts
|
||||
{
|
||||
$doc = new \DOMDocument('1.0', 'UTF-8');
|
||||
$internalErrors = libxml_use_internal_errors(true);
|
||||
$doc->loadHTML('<?xml encoding="utf-8" ?>' . $html);
|
||||
$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
|
||||
libxml_use_internal_errors($internalErrors);
|
||||
|
||||
$elements = $doc->getElementsByTagName($tag);
|
||||
|
||||
Reference in New Issue
Block a user