diff --git src/wp-includes/widgets/class-wp-widget-text.php src/wp-includes/widgets/class-wp-widget-text.php index e6d979347d..f08b908fce 100644 --- src/wp-includes/widgets/class-wp-widget-text.php +++ src/wp-includes/widgets/class-wp-widget-text.php @@ -116,8 +116,8 @@ class WP_Widget_Text extends WP_Widget { } $doc = new DOMDocument(); - $doc->loadHTML( sprintf( - '%s', + @$doc->loadHTML( sprintf( + ' %s', esc_attr( get_bloginfo( 'charset' ) ), $instance['text'] ) ); diff --git tests/phpunit/tests/widgets/text-widget.php tests/phpunit/tests/widgets/text-widget.php index 6c7ec1f102..9bc6edcad4 100644 --- tests/phpunit/tests/widgets/text-widget.php +++ tests/phpunit/tests/widgets/text-widget.php @@ -397,6 +397,7 @@ class Test_WP_Widget_Text extends WP_UnitTestCase { // Check text examples that will not migrate to TinyMCE. $legacy_text_examples = array( '', + '
Quote
', '', "", '',