WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/14/2019 05:04:12 AM (2 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-text.php

    r44574 r44578  
    121121
    122122        $doc = new DOMDocument();
     123
     124        // Suppress warnings generated by loadHTML
     125        $errors = libxml_use_internal_errors( true );
    123126        @$doc->loadHTML(
    124127            sprintf(
     
    128131            )
    129132        );
     133        libxml_use_internal_errors( $errors );
     134
    130135        $body = $doc->getElementsByTagName( 'body' )->item( 0 );
    131136
Note: See TracChangeset for help on using the changeset viewer.