Make WordPress Core

Ticket #18104: wp-class-xmlrpc-server.18104.patch

File wp-class-xmlrpc-server.18104.patch, 1.5 KB (added by xknown, 15 years ago)
  • wp-includes/class-wp-xmlrpc-server.php

     
    11341134                if ( !current_user_can( 'moderate_comments' ) )
    11351135                        return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
    11361136
     1137                if ( ! get_comment($comment_ID) )
     1138                        return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
     1139
    11371140                if ( !current_user_can( 'edit_comment', $comment_ID ) )
    11381141                        return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
    11391142
    11401143                do_action('xmlrpc_call', 'wp.deleteComment');
    11411144
    1142                 if ( ! get_comment($comment_ID) )
    1143                         return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
    1144 
    11451145                return wp_delete_comment($comment_ID);
    11461146        }
    11471147
     
    11841184                if ( !current_user_can( 'moderate_comments' ) )
    11851185                        return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
    11861186
     1187                if ( ! get_comment($comment_ID) )
     1188                        return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
     1189
    11871190                if ( !current_user_can( 'edit_comment', $comment_ID ) )
    11881191                        return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );
    11891192
    11901193                do_action('xmlrpc_call', 'wp.editComment');
    11911194
    1192                 if ( ! get_comment($comment_ID) )
    1193                         return new IXR_Error( 404, __( 'Invalid comment ID.' ) );
    1194 
    11951195                if ( isset($content_struct['status']) ) {
    11961196                        $statuses = get_comment_statuses();
    11971197                        $statuses = array_keys($statuses);