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:
parent
b80e4295e0
commit
ed1f302051
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue