[wp-trac] [WordPress Trac] #45880: edit-form-blocks.php shows Warning when $editor_styles include blank element. (was: Twenty Seventeen shows warning: file_get_contents when new post/page creation in Japanese Settings)
WordPress Trac
noreply at wordpress.org
Sat Jan 12 08:52:49 UTC 2019
#45880: edit-form-blocks.php shows Warning when $editor_styles include blank
element.
--------------------------+------------------------------
Reporter: atachibana | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 5.0.2
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------------
Changes (by atachibana):
* keywords: => has-patch
* component: Themes => Editor
Comment:
This issue was common thing, not Windows nor Japanese related.
The global array variable `$editor_styles` keeps editor-style.css and font
URI information as described in the above comment, but they might be blank
string with some reason. Refer
[https://core.trac.wordpress.org/browser/tags/5.0/src/wp-
content/themes/twentyseventeen/functions.php#L267 Twenty Seventeen's
twentyseventeen_fonts_url()].
Current edit-form-blocks.php assumes two elements of $editor_styles are
not blank and causes this issue. String check should be included.
{{{
foreach ( $editor_styles as $style ) {
if ( preg_match( '~^(https?:)?//~', $style ) ) {
:
// } else { // OLD
} elseif ( $style ) { // NEW
:
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45880#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list