diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index c1f7f5f36e..904cbb0ebb 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -847,6 +847,10 @@ function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' ) // Set variables for storage, fix file filename for query strings. preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches ); + if ( ! $matches ) { + return new WP_Error( 'image_sideload_failed', __( 'Invalid image URL' ) ); + } + $file_array = array(); $file_array['name'] = basename( $matches[0] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 80dd6f6a5c..e283abc61c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34983'; +$wp_version = '4.4-alpha-34984'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.