mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Fix editing images with GD when using streams.
Props rmccue, markoheijnen, nacin fixes #24459 git-svn-id: https://develop.svn.wordpress.org/trunk@24727 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -327,14 +327,11 @@ abstract class WP_Image_Editor {
|
||||
* @return boolean
|
||||
*/
|
||||
protected function make_image( $filename, $function, $arguments ) {
|
||||
$dst_file = $filename;
|
||||
|
||||
// The directory containing the original file may no longer exist when using a replication plugin.
|
||||
wp_mkdir_p( dirname( $dst_file ) );
|
||||
|
||||
if ( $stream = wp_is_stream( $filename ) ) {
|
||||
$filename = null;
|
||||
ob_start();
|
||||
} else {
|
||||
// The directory containing the original file may no longer exist when using a replication plugin.
|
||||
wp_mkdir_p( dirname( $filename ) );
|
||||
}
|
||||
|
||||
$result = call_user_func_array( $function, $arguments );
|
||||
@@ -342,7 +339,7 @@ abstract class WP_Image_Editor {
|
||||
if ( $result && $stream ) {
|
||||
$contents = ob_get_contents();
|
||||
|
||||
$fp = fopen( $dst_file, 'w' );
|
||||
$fp = fopen( $filename, 'w' );
|
||||
|
||||
if ( ! $fp )
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user