mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-02 11:21:57 +01:00
Widgets: Don't log invalid HTML in the Text Widget.
[41215] supresses these irrelevant error messages from the front end, this removes them from the error log, too. Props jeherve. Fixes #43815. Built from https://develop.svn.wordpress.org/trunk@44578 git-svn-id: http://core.svn.wordpress.org/trunk@44409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5ed789dc63
commit
fcd66d09d9
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.1-beta1-44577';
|
||||
$wp_version = '5.1-beta1-44578';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
@ -120,6 +120,9 @@ class WP_Widget_Text extends WP_Widget {
|
||||
}
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
// Suppress warnings generated by loadHTML
|
||||
$errors = libxml_use_internal_errors( true );
|
||||
@$doc->loadHTML(
|
||||
sprintf(
|
||||
'<!DOCTYPE html><html><head><meta charset="%s"></head><body>%s</body></html>',
|
||||
@ -127,6 +130,8 @@ class WP_Widget_Text extends WP_Widget {
|
||||
$instance['text']
|
||||
)
|
||||
);
|
||||
libxml_use_internal_errors( $errors );
|
||||
|
||||
$body = $doc->getElementsByTagName( 'body' )->item( 0 );
|
||||
|
||||
// See $allowedposttags.
|
||||
|
Loading…
Reference in New Issue
Block a user