From c8719868196695f4123a432d57b8bdb2d176f9b5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 17 Sep 2015 04:46:25 +0000 Subject: [PATCH] Uploader: Fire 'wp_handle_upload' in `wp_upload_bits()`. Thusly, the filter in `wp_xmlrpc_server::mw_newMediaObject()` is redundant. Props dllh. Fixes #33539. Built from https://develop.svn.wordpress.org/trunk@34257 git-svn-id: http://core.svn.wordpress.org/trunk@34221 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 5 ++--- wp-includes/functions.php | 3 ++- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 78288bd278..78581cbfab 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -5737,11 +5737,10 @@ class wp_xmlrpc_server extends IXR_Server { 'id' => strval( $id ), 'file' => $name, 'url' => $upload[ 'url' ], - 'type' => $type + 'type' => $upload[ 'type' ] ); - /** This filter is documented in wp-admin/includes/file.php */ - return apply_filters( 'wp_handle_upload', $struct, 'upload' ); + return $struct; } /* MovableType API functions diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2da3569ff1..bad987c9f1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1993,7 +1993,8 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { // Compute the URL $url = $upload['url'] . "/$filename"; - return array( 'file' => $new_file, 'url' => $url, 'error' => false ); + /** This filter is documented in wp-admin/includes/file.php */ + return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false ), 'sideload' ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index ea23c84d11..c820deef89 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34256'; +$wp_version = '4.4-alpha-34257'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.