Ticket #24280: 24280.patch
File 24280.patch, 1.1 KB (added by , 6 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1179 1179 if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) ) 1180 1180 return new IXR_Error( 401, __( 'The post type may not be changed.' ) ); 1181 1181 } else { 1182 if ( ! current_user_can( $post_type->cap->create_posts ) ||! current_user_can( $post_type->cap->edit_posts ) )1182 if ( ! current_user_can( $post_type->cap->create_posts ) && ! current_user_can( $post_type->cap->edit_posts ) ) 1183 1183 return new IXR_Error( 401, __( 'Sorry, you are not allowed to post on this site.' ) ); 1184 1184 } 1185 1185 … … 5647 5647 if ( ! $postdata ) 5648 5648 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); 5649 5649 5650 if ( !current_user_can('publish_posts') ||!current_user_can('edit_post', $post_ID) )5650 if ( !current_user_can('publish_posts') && !current_user_can('edit_post', $post_ID) ) 5651 5651 return new IXR_Error(401, __('Sorry, you cannot publish this post.')); 5652 5652 5653 5653 $postdata['post_status'] = 'publish';