2
0
Fork 0
mirror of https://github.com/discourse/wp-discourse.git synced 2025-10-03 08:59:21 +08:00

Call libxml_use_internal_errors outside of loop

This commit is contained in:
scossar 2018-05-28 12:34:37 -07:00
parent b80e4295e0
commit ed1f302051

View file

@ -163,11 +163,6 @@ class TemplateFunctions {
$poll->parentNode->replaceChild( $link, $poll );
}

// Clear the libxml error buffer.
libxml_clear_errors();
// Restore the previous value of libxml_use_internal_errors.
libxml_use_internal_errors( $use_internal_errors );

$parsed = $doc->saveHTML( $doc->documentElement );

// Remove DOCTYPE, html, and body tags that have been added to the DOMDocument.
@ -176,6 +171,11 @@ class TemplateFunctions {
return $parsed;
}

// Clear the libxml error buffer.
libxml_clear_errors();
// Restore the previous value of libxml_use_internal_errors.
libxml_use_internal_errors( $use_internal_errors );

return $cooked;
}
}