#45739 closed defect (bug) (fixed)
Block Editor: $editor_styles bug.
Reported by: | gqevu6bsiz | Owned by: | pento |
---|---|---|---|
Milestone: | 5.2.3 | Priority: | normal |
Severity: | normal | Version: | 5.0.2 |
Component: | Editor | Keywords: | needs-testing fixed-major |
Focuses: | Cc: |
Description
WP 5.0.2 with TwentySeventeen, it is PHP Warning error on Post Edit/Add New Post screen.
PHP Warning: file_get_contents(/wp-content/themes/twentyseventeen): failed to open stream: Permission denied in wp-admin/edit-form-blocks.php on line 200
It seems to editor_style file is nothing. This problem looks like TwentySeventeen, but I think it would be better to empty check for all themes.
And TwentyNinteen, activate to Classic Editor is not get same problem.
Example To
foreach ( $editor_styles as $style ) { >> if ( empty( $style ) ) { >> continue; >> } if ( preg_match( '~^(https?:)?//~', $style ) ) { $response = wp_remote_get( $style ); if ( ! is_wp_error( $response ) ) { $styles[] = array( 'css' => wp_remote_retrieve_body( $response ), ); } } else { $file = get_theme_file_path( $style ); if ( file_exists( $file ) ) { $styles[] = array( 'css' => file_get_contents( $file ), 'baseURL' => get_theme_file_uri( $style ), ); } } }
Change History (6)
#2
@
5 years ago
- Milestone changed from Awaiting Review to 5.3
- Owner set to pento
- Status changed from new to assigned
Note: See
TracTickets for help on using
tickets.
In 45619: