Code Duplication    Length = 7-7 lines in 2 locations

json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php 1 location

@@ 338-344 (lines=7) @@
335
			return $post_check;
336
		}
337
338
		if ( $has_media || $has_media_by_url ) {
339
			$media_files = ! empty( $input['media'] ) ? $input['media'] : array();
340
			$media_urls = ! empty( $input['media_urls'] ) ? $input['media_urls'] : array();
341
			$media_attrs = ! empty( $input['media_attrs'] ) ? $input['media_attrs'] : array();
342
			$force_parent_id = $post_id;
343
			$media_results = $this->handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs, $force_parent_id );
344
		}
345
346
		// set page template for this post..
347
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 1 location

@@ 338-344 (lines=7) @@
335
			return $post_check;
336
		}
337
338
		if ( $has_media || $has_media_by_url ) {
339
			$media_files = ! empty( $input['media'] ) ? $input['media'] : array();
340
			$media_urls = ! empty( $input['media_urls'] ) ? $input['media_urls'] : array();
341
			$media_attrs = ! empty( $input['media_attrs'] ) ? $input['media_attrs'] : array();
342
			$force_parent_id = $post_id;
343
			$media_results = $this->handle_media_creation_v1_1( $media_files, $media_urls, $media_attrs, $force_parent_id );
344
		}
345
346
		// set page template for this post..
347
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {