Code Duplication    Length = 4-4 lines in 2 locations

src/wp-admin/includes/media.php 1 location

@@ 702-705 (lines=4) @@
699
		if ( $post != $_post )
700
			wp_update_post($post);
701
702
		foreach ( get_attachment_taxonomies($post) as $t ) {
703
			if ( isset($attachment[$t]) )
704
				wp_set_object_terms($attachment_id, array_map('trim', preg_split('/,+/', $attachment[$t])), $t, false);
705
		}
706
	}
707
708
	if ( isset($_POST['insert-gallery']) || isset($_POST['update-gallery']) ) { ?>

src/wp-admin/includes/ajax-actions.php 1 location

@@ 2595-2598 (lines=4) @@
2592
2593
	wp_update_post( $post );
2594
2595
	foreach ( get_attachment_taxonomies( $post ) as $taxonomy ) {
2596
		if ( isset( $attachment_data[ $taxonomy ] ) )
2597
			wp_set_object_terms( $id, array_map( 'trim', preg_split( '/,+/', $attachment_data[ $taxonomy ] ) ), $taxonomy, false );
2598
	}
2599
2600
	if ( ! $attachment = wp_prepare_attachment_for_js( $id ) )
2601
		wp_send_json_error();