Disable libxml errors when parsing Wikipedia information
This commit is contained in:
parent
d0c4bfcf1f
commit
054dc731f1
|
@ -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 '';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user