fix for & errors in URL

This commit is contained in:
Andy Miller 2020-05-14 10:47:36 -06:00
parent a74e07c491
commit a57358f311
No known key found for this signature in database
GPG Key ID: 06C5EE41E242681B
2 changed files with 5 additions and 1 deletions

View File

@ -19,6 +19,7 @@
"ext-curl": "*",
"ext-zip": "*",
"ext-dom": "*",
"ext-libxml": "*",
"symfony/polyfill-iconv": "^1.15",
"symfony/polyfill-php72": "^1.15",
"symfony/polyfill-php73": "^1.15",

View File

@ -72,8 +72,11 @@ class Excerpts
*/
public static function getExcerptFromHtml($html, $tag)
{
$doc = new \DOMDocument();
$doc = new \DOMDocument('1.0', 'UTF-8');
$internalErrors = libxml_use_internal_errors(true);
$doc->loadHTML($html);
libxml_use_internal_errors($internalErrors);
$elements = $doc->getElementsByTagName($tag);
$excerpt = null;