Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 4884-4889 (lines=6) @@
4881
			return new IXR_Error( 401, $error_message );
4882
4883
		// Check for a valid post format if one was given
4884
		if ( isset( $content_struct['wp_post_format'] ) ) {
4885
			$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
4886
			if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
4887
				return new IXR_Error( 404, __( 'Invalid post format' ) );
4888
			}
4889
		}
4890
4891
		// Let WordPress generate the post_name (slug) unless
4892
		// one has been provided.
@@ 5205-5210 (lines=6) @@
5202
			return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
5203
5204
		// Check for a valid post format if one was given
5205
		if ( isset( $content_struct['wp_post_format'] ) ) {
5206
			$content_struct['wp_post_format'] = sanitize_key( $content_struct['wp_post_format'] );
5207
			if ( !array_key_exists( $content_struct['wp_post_format'], get_post_format_strings() ) ) {
5208
				return new IXR_Error( 404, __( 'Invalid post format' ) );
5209
			}
5210
		}
5211
5212
		$this->escape($postdata);
5213