From e6322d0afe4c8f11ea4462939291c58c6f84c7fe Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 11 Feb 2018 16:25:31 +0000 Subject: [PATCH] Media: In `WP_Image_Editor::make_image()`, close previously opened output buffer if the file could not be created. Props dhanendran, gnif. Fixes #43255. Built from https://develop.svn.wordpress.org/trunk@42695 git-svn-id: http://core.svn.wordpress.org/trunk@42523 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor.php | 3 +++ wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 1bf80e392d..3d38cd1cbb 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -409,6 +409,9 @@ abstract class WP_Image_Editor { $fp = fopen( $filename, 'w' ); if ( ! $fp ) { + if ( $stream ) { + ob_end_clean(); + } return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index b08cf71018..7420db266b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42694'; +$wp_version = '5.0-alpha-42695'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.