XML-RPC: Return an error for getRecentPosts (mw and blogger) if the user does not have edit_posts.

props redsweater.
fixes #22320.



git-svn-id: http://core.svn.wordpress.org/trunk@23636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-03-07 06:52:37 +00:00
parent 3828d67fad
commit 799ac18951
1 changed files with 6 additions and 0 deletions

View File

@ -3784,6 +3784,9 @@ class wp_xmlrpc_server extends IXR_Server {
if ( !$user = $this->login($username, $password) )
return $this->error;
if ( ! current_user_can( 'edit_posts' ) )
return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
do_action('xmlrpc_call', 'blogger.getRecentPosts');
$posts_list = wp_get_recent_posts( $query );
@ -4757,6 +4760,9 @@ class wp_xmlrpc_server extends IXR_Server {
if ( !$user = $this->login($username, $password) )
return $this->error;
if ( ! current_user_can( 'edit_posts' ) )
return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
do_action('xmlrpc_call', 'metaWeblog.getRecentPosts');
$posts_list = wp_get_recent_posts( $query );