Code Duplication    Length = 6-6 lines in 2 locations

_inc/lib/class.media.php 1 location

@@ 453-458 (lines=6) @@
450
		$media_item = get_post( $media_id );
451
		$has_original_media = self::get_original_media( $media_id );
452
453
		if ( ! $has_original_media ) {
454
			// The first time that the media is updated
455
			// the original media is stored into the revision_history
456
			$snapshot = self::get_snapshot( $media_item );
457
			add_post_meta( $media_id, self::$WP_ORIGINAL_MEDIA, $snapshot, true );
458
		}
459
460
		// save temporary file in the correct location
461
		$uploaded_file = self::save_temporary_file( $file_array, $media_id );

json-endpoints/class.wpcom-json-api-edit-media-v1-2-endpoint.php 1 location

@@ 362-367 (lines=6) @@
359
360
			$has_original_media = Jetpack_Media::get_original_media( $media_id );
361
362
			if ( ! $has_original_media ) {
363
				// The first time that the media is updated
364
				// the original media is stored into the revision_history
365
				$snapshot = $this->get_snapshot( $media_item );
366
				add_post_meta( $media_id, Jetpack_Media::$WP_ORIGINAL_MEDIA, $snapshot, true );
367
			}
368
369
			// save the temporal file locally
370
			$temporal_file = $media_file ? $media_file : $this->build_file_array_from_url( $media_id, $media_url );