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:
parent
889ff09208
commit
54016999e1
10
xmlrpc.php
10
xmlrpc.php
|
@ -833,13 +833,15 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
return $this->error;
|
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);
|
$upload = wp_upload_bits($name, $type, $bits);
|
||||||
if ( ! empty($upload['error']) ) {
|
if ( ! empty($upload['error']) ) {
|
||||||
logIO('O', '(MW) Could not write file '.$name);
|
logIO('O', '(MW) Could not write file '.$name);
|
||||||
return new IXR_Error(500, 'Could not write file '.$name);
|
return new IXR_Error(500, 'Could not write file '.$name);
|
||||||
}
|
}
|
||||||
|
return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ) );
|
||||||
return array('url' => $upload['url']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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');
|
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type');
|
||||||
|
|
||||||
wp_new_comment($commentdata);
|
$comment_ID = wp_new_comment($commentdata);
|
||||||
do_action('pingback_post', $wpdb->insert_id);
|
do_action('pingback_post', $comment_ID);
|
||||||
|
|
||||||
return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
|
return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue