Ticket #24459: 24459.4.diff
File 24459.4.diff, 1.8 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-image-editor-gd.php
401 401 return imagejpeg( $this->image, null, $this->quality ); 402 402 } 403 403 } 404 405 /** 406 * Either calls editor's save function or handles file as a stream. 407 * 408 * @since 3.5.0 409 * @access protected 410 * 411 * @param string|stream $filename 412 * @param callable $function 413 * @param array $arguments 414 * @return boolean 415 */ 416 protected function make_image( $filename, $function, $arguments ) { 417 if ( wp_is_stream( $filename ) ) 418 $arguments[1] = null; 419 420 return parent::make_image( $filename, $function, $arguments ); 421 } 404 422 } -
wp-includes/class-wp-image-editor.php
327 327 * @return boolean 328 328 */ 329 329 protected function make_image( $filename, $function, $arguments ) { 330 $dst_file = $filename;331 332 // The directory containing the original file may no longer exist when using a replication plugin.333 wp_mkdir_p( dirname( $dst_file ) );334 335 330 if ( $stream = wp_is_stream( $filename ) ) { 336 $filename = null;337 331 ob_start(); 332 } else { 333 // The directory containing the original file may no longer exist when using a replication plugin. 334 wp_mkdir_p( dirname( $filename ) ); 338 335 } 339 336 340 337 $result = call_user_func_array( $function, $arguments ); … … 342 339 if ( $result && $stream ) { 343 340 $contents = ob_get_contents(); 344 341 345 $fp = fopen( $ dst_file, 'w' );342 $fp = fopen( $filename, 'w' ); 346 343 347 344 if ( ! $fp ) 348 345 return false;