WordPress.org

Make WordPress Core

Ticket #41622: 41622.0.diff

File 41622.0.diff, 1.3 KB (added by westonruter, 2 years ago)
  • src/wp-includes/widgets/class-wp-widget-text.php

    diff --git src/wp-includes/widgets/class-wp-widget-text.php src/wp-includes/widgets/class-wp-widget-text.php
    index e6d979347d..f08b908fce 100644
    class WP_Widget_Text extends WP_Widget { 
    116116                }
    117117
    118118                $doc = new DOMDocument();
    119                 $doc->loadHTML( sprintf(
    120                         '<html><head><meta charset="%s"></head><body>%s</body></html>',
     119                @$doc->loadHTML( sprintf(
     120                        '<!DOCTYPE html> <html><head><meta charset="%s"></head><body>%s</body></html>',
    121121                        esc_attr( get_bloginfo( 'charset' ) ),
    122122                        $instance['text']
    123123                ) );
  • tests/phpunit/tests/widgets/text-widget.php

    diff --git tests/phpunit/tests/widgets/text-widget.php tests/phpunit/tests/widgets/text-widget.php
    index 6c7ec1f102..9bc6edcad4 100644
    class Test_WP_Widget_Text extends WP_UnitTestCase { 
    397397                // Check text examples that will not migrate to TinyMCE.
    398398                $legacy_text_examples = array(
    399399                        '<span class="hello"></span>',
     400                        '<blockquote>Quote <footer>Citation</footer></blockquote>',
    400401                        '<span></span>',
    401402                        "<ul>\n<li><a href=\"#\" class=\"location\"></a>List Item 1</li>\n<li><a href=\"#\" class=\"location\"></a>List Item 2</li>\n</ul>",
    402403                        '<a href="#" class="map"></a>',