Widgets: Suppress PHP warnings raised by DOMDocument::loadHTML() in WP_Widget_Text::is_legacy_instance() which could appear in Text widget forms.

Also explicitly use HTML5 doctype when parsing Text widget contents in legacy mode detection.

Merge of [41251] to the 4.8 branch.

Amends [41050].
See #40951.
Fixes #41622.
Built from https://develop.svn.wordpress.org/branches/4.8@41391


git-svn-id: http://core.svn.wordpress.org/branches/4.8@41224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2017-09-19 07:39:33 +00:00
parent 9cbea2762a
commit d82e0f5c86
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8.2-alpha-41336';
$wp_version = '4.8.2-alpha-41391';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -115,8 +115,8 @@ class WP_Widget_Text extends WP_Widget {
}
$doc = new DOMDocument();
$doc->loadHTML( sprintf(
'<html><head><meta charset="%s"></head><body>%s</body></html>',
@$doc->loadHTML( sprintf(
'<!DOCTYPE html><html><head><meta charset="%s"></head><body>%s</body></html>',
esc_attr( get_bloginfo( 'charset' ) ),
$instance['text']
) );