Upload filters in xmlrpc. fixes #3388

git-svn-id: http://svn.automattic.com/wordpress/trunk@4526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-11-24 16:39:51 +00:00
parent 889ff09208
commit 54016999e1
1 changed files with 6 additions and 4 deletions

View File

@ -833,13 +833,15 @@ class wp_xmlrpc_server extends IXR_Server {
return $this->error;
}
if ( $upload_err = apply_filters( "pre_upload_error", false ) )
return new IXR_Error(500, $upload_err);
$upload = wp_upload_bits($name, $type, $bits);
if ( ! empty($upload['error']) ) {
logIO('O', '(MW) Could not write file '.$name);
return new IXR_Error(500, 'Could not write file '.$name);
}
return array('url' => $upload['url']);
return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) );
}
@ -1215,8 +1217,8 @@ class wp_xmlrpc_server extends IXR_Server {
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');
wp_new_comment($commentdata);
do_action('pingback_post', $wpdb->insert_id);
$comment_ID = wp_new_comment($commentdata);
do_action('pingback_post', $comment_ID);
return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
}