Code Duplication    Length = 10-10 lines in 2 locations

wp-includes/class-wp-xmlrpc-server.php 2 locations

@@ 4854-4863 (lines=10) @@
4851
				$post_type = 'page';
4852
				if ( !empty( $content_struct['wp_page_template'] ) )
4853
					$page_template = $content_struct['wp_page_template'];
4854
			} elseif ( $content_struct['post_type'] == 'post' ) {
4855
				if ( $publish )
4856
					$cap  = 'publish_posts';
4857
				elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] )
4858
					$cap  = 'publish_posts';
4859
				else
4860
					$cap = 'edit_posts';
4861
				$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
4862
				$post_type = 'post';
4863
			} else {
4864
				// No other post_type values are allowed here
4865
				return new IXR_Error( 401, __( 'Invalid post type.' ) );
4866
			}
@@ 4867-4876 (lines=10) @@
4864
				// No other post_type values are allowed here
4865
				return new IXR_Error( 401, __( 'Invalid post type.' ) );
4866
			}
4867
		} else {
4868
			if ( $publish )
4869
				$cap  = 'publish_posts';
4870
			elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'])
4871
				$cap  = 'publish_posts';
4872
			else
4873
				$cap = 'edit_posts';
4874
			$error_message = __( 'Sorry, you are not allowed to publish posts on this site.' );
4875
			$post_type = 'post';
4876
		}
4877
4878
		if ( ! current_user_can( get_post_type_object( $post_type )->cap->create_posts ) )
4879
			return new IXR_Error( 401, __( 'Sorry, you are not allowed to publish posts on this site.' ) );