Ticket #17981: 17981-refresh.diff
| File 17981-refresh.diff, 3.5 KB (added by ericmann, 15 months ago) |
|---|
-
wp-includes/class-wp-xmlrpc-server.php
1649 1649 if ( !$user = $this->login($username, $password) ) 1650 1650 return $this->error; 1651 1651 1652 if ( !current_user_can( 'moderate_comments' ) )1653 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );1654 1655 1652 do_action('xmlrpc_call', 'wp.getComment'); 1656 1653 1657 1654 if ( ! $comment = get_comment($comment_id) ) 1658 1655 return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); 1659 1656 1657 if ( ! current_user_can( 'edit_comment', $comment_id ) ) 1658 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) ); 1659 1660 1660 // Format page date. 1661 1661 $comment_date = mysql2date('Ymd\TH:i:s', $comment->comment_date, false); 1662 1662 $comment_date_gmt = mysql2date('Ymd\TH:i:s', $comment->comment_date_gmt, false); … … 1723 1723 if ( !$user = $this->login($username, $password) ) 1724 1724 return $this->error; 1725 1725 1726 if ( !current_user_can( 'moderate_comments' ) )1727 return new IXR_Error( 401, __( 'Sorry, you cannot edit comments.' ) );1728 1729 1726 do_action('xmlrpc_call', 'wp.getComments'); 1730 1727 1731 1728 if ( isset($struct['status']) ) … … 1791 1788 if ( !$user = $this->login($username, $password) ) 1792 1789 return $this->error; 1793 1790 1794 if ( !current_user_can( 'moderate_comments' ) )1795 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );1796 1797 1791 if ( ! get_comment($comment_ID) ) 1798 1792 return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); 1799 1793 1800 1794 if ( !current_user_can( 'edit_comment', $comment_ID ) ) 1801 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );1795 return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); 1802 1796 1803 1797 do_action('xmlrpc_call', 'wp.deleteComment'); 1804 1798 … … 1841 1835 if ( !$user = $this->login($username, $password) ) 1842 1836 return $this->error; 1843 1837 1844 if ( !current_user_can( 'moderate_comments' ) )1845 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );1846 1847 1838 if ( ! get_comment($comment_ID) ) 1848 1839 return new IXR_Error( 404, __( 'Invalid comment ID.' ) ); 1849 1840 1850 1841 if ( !current_user_can( 'edit_comment', $comment_ID ) ) 1851 return new IXR_Error( 403, __( 'You are not allowed to moderate comments on this site.' ) );1842 return new IXR_Error( 403, __( 'You are not allowed to moderate or edit this comment.' ) ); 1852 1843 1853 1844 do_action('xmlrpc_call', 'wp.editComment'); 1854 1845 … … 1994 1985 if ( !$user = $this->login($username, $password) ) 1995 1986 return $this->error; 1996 1987 1997 if ( !current_user_can( ' moderate_comments' ) )1988 if ( !current_user_can( 'publish_posts' ) ) 1998 1989 return new IXR_Error( 403, __( 'You are not allowed access to details about this site.' ) ); 1999 1990 2000 1991 do_action('xmlrpc_call', 'wp.getCommentStatusList'); … … 2021 2012 if ( !$user = $this->login($username, $password) ) 2022 2013 return $this->error; 2023 2014 2024 if ( !current_user_can( 'edit_posts' ) ) 2025 return new IXR_Error( 403, __( 'You are not allowed access to details about comments.' ) ); 2015 $post = wp_get_single_post( $post_id, ARRAY_A ); 2016 if ( empty( $post['ID'] ) ) 2017 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 2026 2018 2019 if ( !current_user_can( 'edit_post', $post_id ) ) 2020 return new IXR_Error( 403, __( 'You are not allowed access to details of this post.' ) ); 2021 2027 2022 do_action('xmlrpc_call', 'wp.getCommentCount'); 2028 2023 2029 2024 $count = wp_count_comments( $post_id );
