From b09f9fa15792c258fe3038ab5b0cd70142df839d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 18 Mar 2013 18:05:23 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-image-editor.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index 099df1e0f3..7d76d66ecd 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -326,6 +326,9 @@ abstract class WP_Image_Editor { 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();