From b7de0935b97dc62526ae34c697251c25783fb585 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 11 Oct 2018 08:11:23 +0000 Subject: [PATCH] Media: In `WP_Image_Editor::make_image()`, close previously opened output buffer if the file could not be created. In addition to the merge noted below, includes important brackets added in [42343]. Props dhanendran, gnif, SergeyBiryukov. Merges [42695] and [42702] to the 5.0 branch. Fixes #43255. Built from https://develop.svn.wordpress.org/branches/5.0@43717 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43546 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 85a4916117..62e1575a1d 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -406,8 +406,10 @@ abstract class WP_Image_Editor { $fp = fopen( $filename, 'w' ); - if ( ! $fp ) + if ( ! $fp ) { + ob_end_clean(); return false; + } fwrite( $fp, $contents ); fclose( $fp ); diff --git a/wp-includes/version.php b/wp-includes/version.php index eb25c4c050..a795f4386c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43716'; +$wp_version = '5.0-alpha-43717'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.