fix DomDocument initiation without encoding provided

This commit is contained in:
ghost 2023-06-14 02:20:00 +03:00
parent fcda6b9885
commit 1d5d5ead5d

View File

@ -496,7 +496,7 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND
// Parse content
$dom = new DomDocument();
@$dom->loadHTML($content);
@$dom->loadHTML(sprintf('<?xml encoding="%s" ?>', mb_detect_encoding($content)) . $content);
// Skip index page links without titles
$title = @$dom->getElementsByTagName('title');