Require the edit_posts capability for wp_getPostFormats.

Props maxcutler.
Fixes #20154


git-svn-id: http://svn.automattic.com/wordpress/trunk@20566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2012-04-23 21:41:50 +00:00
parent 43979f17ac
commit 9cbd3def67
1 changed files with 3 additions and 0 deletions

View File

@ -2922,6 +2922,9 @@ class wp_xmlrpc_server extends IXR_Server {
if ( !$user = $this->login( $username, $password ) ) if ( !$user = $this->login( $username, $password ) )
return $this->error; return $this->error;
if ( !current_user_can( 'edit_posts' ) )
return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) );
do_action( 'xmlrpc_call', 'wp.getPostFormats' ); do_action( 'xmlrpc_call', 'wp.getPostFormats' );
$formats = get_post_format_strings(); $formats = get_post_format_strings();