Make WordPress Core


Ignore:
Timestamp:
03/07/2013 06:52:37 AM (11 years ago)
Author:
nacin
Message:

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

props redsweater.
fixes #22320.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r23591 r23636  
    37853785            return $this->error;
    37863786
     3787        if ( ! current_user_can( 'edit_posts' ) )
     3788            return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
     3789
    37873790        do_action('xmlrpc_call', 'blogger.getRecentPosts');
    37883791
     
    47574760        if ( !$user = $this->login($username, $password) )
    47584761            return $this->error;
     4762
     4763        if ( ! current_user_can( 'edit_posts' ) )
     4764            return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
    47594765
    47604766        do_action('xmlrpc_call', 'metaWeblog.getRecentPosts');
Note: See TracChangeset for help on using the changeset viewer.