Make WP_Image_Editor::make_image() safe for replication plugins by making sure the directory for the image being made exists.

Props batmoo
fixes #23306


git-svn-id: http://core.svn.wordpress.org/trunk@23744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Ryan Boren 2013-03-18 18:05:23 +00:00
parent dfd8479246
commit b09f9fa157
1 changed files with 3 additions and 0 deletions

View File

@ -326,6 +326,9 @@ abstract class WP_Image_Editor {
protected function make_image( $filename, $function, $arguments ) { protected function make_image( $filename, $function, $arguments ) {
$dst_file = $filename; $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 ) ) { if ( $stream = wp_is_stream( $filename ) ) {
$filename = null; $filename = null;
ob_start(); ob_start();