Changeset 20637 for trunk/wp-includes/class-wp-xmlrpc-server.php
- Timestamp:
- 04/30/2012 12:19:32 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20636 r20637 832 832 833 833 if ( $update ) { 834 if ( ! get_post( $post_data['ID'] ) ) 835 return new IXR_Error( 401, __( 'Invalid post ID.' ) ); 834 836 if ( ! current_user_can( $post_type->cap->edit_post, $post_data['ID'] ) ) 835 837 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) ); … … 1815 1817 } 1816 1818 1819 $page = get_page($page_id); 1820 if ( ! $page ) 1821 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 1822 1817 1823 if ( !current_user_can( 'edit_page', $page_id ) ) 1818 1824 return new IXR_Error( 401, __( 'Sorry, you cannot edit this page.' ) ); 1819 1825 1820 1826 do_action('xmlrpc_call', 'wp.getPage'); 1821 1822 // Lookup page info.1823 $page = get_page($page_id);1824 1827 1825 1828 // If we found the page then format the data. … … 3269 3272 return $this->error; 3270 3273 3274 $post_data = wp_get_single_post($post_ID, ARRAY_A); 3275 if ( ! $post_data ) 3276 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 3277 3271 3278 if ( !current_user_can( 'edit_post', $post_ID ) ) 3272 3279 return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); 3273 3280 3274 3281 do_action('xmlrpc_call', 'blogger.getPost'); 3275 3276 $post_data = wp_get_single_post($post_ID, ARRAY_A);3277 3282 3278 3283 $categories = implode(',', wp_get_post_categories($post_ID)); … … 4219 4224 return $this->error; 4220 4225 4226 $postdata = wp_get_single_post($post_ID, ARRAY_A); 4227 if ( ! $postdata ) 4228 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4229 4221 4230 if ( !current_user_can( 'edit_post', $post_ID ) ) 4222 4231 return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) ); 4223 4232 4224 4233 do_action('xmlrpc_call', 'metaWeblog.getPost'); 4225 4226 $postdata = wp_get_single_post($post_ID, ARRAY_A);4227 4234 4228 4235 if ($postdata['post_date'] != '') { … … 4687 4694 return $this->error; 4688 4695 4696 if ( ! get_post( $post_ID ) ) 4697 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4698 4689 4699 if ( !current_user_can( 'edit_post', $post_ID ) ) 4690 4700 return new IXR_Error( 401, __( 'Sorry, you can not edit this post.' ) ); … … 4730 4740 do_action('xmlrpc_call', 'mt.setPostCategories'); 4731 4741 4742 if ( ! get_post( $post_ID ) ) 4743 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4744 4732 4745 if ( !current_user_can('edit_post', $post_ID) ) 4733 4746 return new IXR_Error(401, __('Sorry, you cannot edit this post.')); … … 4837 4850 do_action('xmlrpc_call', 'mt.publishPost'); 4838 4851 4852 $postdata = wp_get_single_post($post_ID, ARRAY_A); 4853 if ( ! $postdata ) 4854 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 4855 4839 4856 if ( !current_user_can('publish_posts') || !current_user_can('edit_post', $post_ID) ) 4840 4857 return new IXR_Error(401, __('Sorry, you cannot publish this post.')); 4841 4842 $postdata = wp_get_single_post($post_ID,ARRAY_A);4843 4858 4844 4859 $postdata['post_status'] = 'publish';
Note: See TracChangeset
for help on using the changeset viewer.