Skip to content

Commit 830632f

Browse files
committed
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, sergey. Merges [42695] and [42702] to the 4.9 branch. Fixes #43255. git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43649 602fd350-edb4-49c9-b593-d223f7449a82
1 parent dc70d3e commit 830632f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wp-includes/class-wp-image-editor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,10 @@ protected function make_image( $filename, $function, $arguments ) {
406406

407407
$fp = fopen( $filename, 'w' );
408408

409-
if ( ! $fp )
409+
if ( ! $fp ) {
410+
ob_end_clean();
410411
return false;
412+
}
411413

412414
fwrite( $fp, $contents );
413415
fclose( $fp );

0 commit comments

Comments
 (0)