Skip to content

Commit

Permalink
Media: In WP_Image_Editor::make_image(), close previously opened outp…
Browse files Browse the repository at this point in the history
…ut 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
  • Loading branch information
getsource committed Sep 18, 2018
1 parent dc70d3e commit 830632f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wp-includes/class-wp-image-editor.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -406,8 +406,10 @@ protected function make_image( $filename, $function, $arguments ) {


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


if ( ! $fp ) if ( ! $fp ) {
ob_end_clean();
return false; return false;
}


fwrite( $fp, $contents ); fwrite( $fp, $contents );
fclose( $fp ); fclose( $fp );
Expand Down

0 comments on commit 830632f

Please sign in to comment.