Disable libxml errors when parsing Wikipedia information

This commit is contained in:
Joshua Ramon Enslin 2021-11-18 23:53:11 +01:00
parent d0c4bfcf1f
commit 054dc731f1
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -150,10 +150,12 @@ final class NodaWikidataFetcher {
if (empty($wikipedia_cont = MD_STD::runCurl($linkUrl))) return ''; if (empty($wikipedia_cont = MD_STD::runCurl($linkUrl))) return '';
libxml_use_internal_errors(true);
$doc = new DOMDocument(); $doc = new DOMDocument();
if (!$doc->loadHTML($wikipedia_cont)) { if (!$doc->loadHTML($wikipedia_cont)) {
return ''; return '';
} }
libxml_use_internal_errors(false);
if (!($wikidataLinkLi = $doc->getElementById("t-wikibase"))) { if (!($wikidataLinkLi = $doc->getElementById("t-wikibase"))) {
return ''; return '';