Check for comment existence before checking edit_comment meta cap. props xknown, fixes #18104.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c8af09ed2c
commit
3ee964c10c
|
@ -1134,14 +1134,14 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
if ( !current_user_can( 'moderate_comments' ) )
|
if ( !current_user_can( 'moderate_comments' ) )
|
||||||
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
||||||
|
|
||||||
|
if ( ! get_comment($comment_ID) )
|
||||||
|
return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
|
||||||
|
|
||||||
if ( !current_user_can( 'edit_comment', $comment_ID ) )
|
if ( !current_user_can( 'edit_comment', $comment_ID ) )
|
||||||
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.deleteComment');
|
do_action('xmlrpc_call', 'wp.deleteComment');
|
||||||
|
|
||||||
if ( ! get_comment($comment_ID) )
|
|
||||||
return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
|
|
||||||
|
|
||||||
return wp_delete_comment($comment_ID);
|
return wp_delete_comment($comment_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1184,14 +1184,14 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
if ( !current_user_can( 'moderate_comments' ) )
|
if ( !current_user_can( 'moderate_comments' ) )
|
||||||
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
||||||
|
|
||||||
|
if ( ! get_comment($comment_ID) )
|
||||||
|
return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
|
||||||
|
|
||||||
if ( !current_user_can( 'edit_comment', $comment_ID ) )
|
if ( !current_user_can( 'edit_comment', $comment_ID ) )
|
||||||
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
|
||||||
|
|
||||||
do_action('xmlrpc_call', 'wp.editComment');
|
do_action('xmlrpc_call', 'wp.editComment');
|
||||||
|
|
||||||
if ( ! get_comment($comment_ID) )
|
|
||||||
return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
|
|
||||||
|
|
||||||
if ( isset($content_struct['status']) ) {
|
if ( isset($content_struct['status']) ) {
|
||||||
$statuses = get_comment_statuses();
|
$statuses = get_comment_statuses();
|
||||||
$statuses = array_keys($statuses);
|
$statuses = array_keys($statuses);
|
||||||
|
|
Loading…
Reference in New Issue