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:
parent
3828d67fad
commit
799ac18951
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue