Ticket #34521: 34521-you-cannot-----you are not allowed.patch
File 34521-you-cannot-----you are not allowed.patch, 6.2 KB (added by , 7 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1731 1731 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 1732 1732 1733 1733 if ( ! current_user_can( 'edit_post', $post_id ) ) 1734 return new IXR_Error( 401, __( 'Sorry, you cannotedit this post.' ) );1734 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 1735 1735 1736 1736 return $this->_prepare_post( $post, $fields ); 1737 1737 } … … 2412 2412 do_action( 'xmlrpc_call', 'wp.getUser' ); 2413 2413 2414 2414 if ( ! current_user_can( 'edit_user', $user_id ) ) 2415 return new IXR_Error( 401, __( 'Sorry, you cannotedit users.' ) );2415 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit users.' ) ); 2416 2416 2417 2417 $user_data = get_userdata( $user_id ); 2418 2418 … … 2543 2543 do_action( 'xmlrpc_call', 'wp.getProfile' ); 2544 2544 2545 2545 if ( ! current_user_can( 'edit_user', $user->ID ) ) 2546 return new IXR_Error( 401, __( 'Sorry, you cannotedit your profile.' ) );2546 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); 2547 2547 2548 2548 $user_data = get_userdata( $user->ID ); 2549 2549 … … 2589 2589 do_action( 'xmlrpc_call', 'wp.editProfile' ); 2590 2590 2591 2591 if ( ! current_user_can( 'edit_user', $user->ID ) ) 2592 return new IXR_Error( 401, __( 'Sorry, you cannotedit your profile.' ) );2592 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit your profile.' ) ); 2593 2593 2594 2594 // holds data of the user 2595 2595 $user_data = array(); … … 2659 2659 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 2660 2660 2661 2661 if ( !current_user_can( 'edit_page', $page_id ) ) 2662 return new IXR_Error( 401, __( 'Sorry, you cannotedit this page.' ) );2662 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this page.' ) ); 2663 2663 2664 2664 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 2665 2665 do_action( 'xmlrpc_call', 'wp.getPage' ); … … 2700 2700 return $this->error; 2701 2701 2702 2702 if ( !current_user_can( 'edit_pages' ) ) 2703 return new IXR_Error( 401, __( 'Sorry, you cannotedit pages.' ) );2703 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) ); 2704 2704 2705 2705 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 2706 2706 do_action( 'xmlrpc_call', 'wp.getPages' ); … … 2902 2902 return $this->error; 2903 2903 2904 2904 if ( !current_user_can( 'edit_pages' ) ) 2905 return new IXR_Error( 401, __( 'Sorry, you cannotedit pages.' ) );2905 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit pages.' ) ); 2906 2906 2907 2907 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 2908 2908 do_action( 'xmlrpc_call', 'wp.getPageList' ); … … 2958 2958 return $this->error; 2959 2959 2960 2960 if ( !current_user_can('edit_posts') ) 2961 return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );2961 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); 2962 2962 2963 2963 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 2964 2964 do_action( 'xmlrpc_call', 'wp.getAuthors' ); … … 4286 4286 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4287 4287 4288 4288 if ( ! current_user_can( 'edit_post', $revision->post_parent ) ) 4289 return new IXR_Error( 401, __( 'Sorry, you cannotedit this post.' ) );4289 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 4290 4290 4291 4291 // Check if revisions are disabled. 4292 4292 if ( ! wp_revisions_enabled( $post ) ) … … 4455 4455 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4456 4456 4457 4457 if ( !current_user_can( 'edit_post', $post_ID ) ) 4458 return new IXR_Error( 401, __( 'Sorry, you cannotedit this post.' ) );4458 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 4459 4459 4460 4460 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 4461 4461 do_action( 'xmlrpc_call', 'blogger.getPost' ); … … 4508 4508 return $this->error; 4509 4509 4510 4510 if ( ! current_user_can( 'edit_posts' ) ) 4511 return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );4511 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); 4512 4512 4513 4513 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 4514 4514 do_action( 'xmlrpc_call', 'blogger.getRecentPosts' ); … … 5483 5483 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 5484 5484 5485 5485 if ( !current_user_can( 'edit_post', $post_ID ) ) 5486 return new IXR_Error( 401, __( 'Sorry, you cannotedit this post.' ) );5486 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 5487 5487 5488 5488 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5489 5489 do_action( 'xmlrpc_call', 'metaWeblog.getPost' ); … … 5613 5613 return $this->error; 5614 5614 5615 5615 if ( ! current_user_can( 'edit_posts' ) ) 5616 return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );5616 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) ); 5617 5617 5618 5618 /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ 5619 5619 do_action( 'xmlrpc_call', 'metaWeblog.getRecentPosts' ); … … 5824 5824 $post_id = (int) $data['post_id']; 5825 5825 5826 5826 if ( ! current_user_can( 'edit_post', $post_id ) ) 5827 return new IXR_Error( 401, __( 'Sorry, you cannotedit this post.' ) );5827 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); 5828 5828 } 5829 5829 $attachment = array( 5830 5830 'post_title' => $name, … … 6049 6049 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 6050 6050 6051 6051 if ( !current_user_can('edit_post', $post_ID) ) 6052 return new IXR_Error(401, __('Sorry, you cannotedit this post.'));6052 return new IXR_Error(401, __('Sorry, you are not allowed to edit this post.')); 6053 6053 6054 6054 $catids = array(); 6055 6055 foreach ( $categories as $cat ) { … … 6168 6168 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 6169 6169 6170 6170 if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) ) 6171 return new IXR_Error(401, __('Sorry, you cannotpublish this post.'));6171 return new IXR_Error(401, __('Sorry, you are not allowed to publish this post.')); 6172 6172 6173 6173 $postdata['post_status'] = 'publish'; 6174 6174